Commit 06441e6b92584aed42a93b9ac3075372367bd8cf
1 parent
1c35e458
Exists in
master
and in
2 other branches
Less send [skip ci]
Showing
5 changed files
with
5 additions
and
10 deletions
Show diff stats
lib/searchkick/bulk_reindex_job.rb
... | ... | @@ -14,9 +14,8 @@ module Searchkick |
14 | 14 | relation = Searchkick.load_records(relation, record_ids) |
15 | 15 | relation = relation.search_import if relation.respond_to?(:search_import) |
16 | 16 | |
17 | - # TODO expose functionality on index | |
18 | - index.send(:record_indexer).reindex(relation, mode: :inline, method_name: method_name, full: false) | |
19 | - index.send(:relation_indexer).batch_completed(batch_id) if batch_id | |
17 | + RecordIndexer.new(index).reindex(relation, mode: :inline, method_name: method_name, full: false) | |
18 | + RelationIndexer.new(index).batch_completed(batch_id) if batch_id | |
20 | 19 | end |
21 | 20 | end |
22 | 21 | end | ... | ... |
lib/searchkick/index.rb
... | ... | @@ -301,10 +301,6 @@ module Searchkick |
301 | 301 | @relation_indexer ||= RelationIndexer.new(self) |
302 | 302 | end |
303 | 303 | |
304 | - def record_indexer | |
305 | - @record_indexer ||= RecordIndexer.new(self) | |
306 | - end | |
307 | - | |
308 | 304 | def index_settings |
309 | 305 | settings.values.first["settings"]["index"] |
310 | 306 | end | ... | ... |
lib/searchkick/model.rb
... | ... | @@ -28,7 +28,7 @@ module Searchkick |
28 | 28 | def reindex(method_name = nil, mode: nil, refresh: false) |
29 | 29 | mode ||= Searchkick.callbacks_value || self.class.searchkick_index.options[:callbacks] || true |
30 | 30 | mode = :inline if mode == :bulk |
31 | - result = self.class.searchkick_index.send(:record_indexer).reindex([self], mode: mode, method_name: method_name, single: true) | |
31 | + result = RecordIndexer.new(self.class.searchkick_index).reindex([self], mode: mode, method_name: method_name, single: true) | |
32 | 32 | self.class.searchkick_index.refresh if refresh |
33 | 33 | result |
34 | 34 | end | ... | ... |
lib/searchkick/process_batch_job.rb
lib/searchkick/reindex_v2_job.rb
... | ... | @@ -11,7 +11,7 @@ module Searchkick |
11 | 11 | # but keep for now for backwards compatibility |
12 | 12 | model = model.unscoped if model.respond_to?(:unscoped) |
13 | 13 | items = [{id: id, routing: routing}] |
14 | - index.send(:record_indexer).reindex_items(model, items, method_name: method_name, single: true) | |
14 | + RecordIndexer.new(index).reindex_items(model, items, method_name: method_name, single: true) | |
15 | 15 | end |
16 | 16 | end |
17 | 17 | end | ... | ... |