lib/searchkick/index.rb in searchkick-4.0.2 vs lib/searchkick/index.rb in searchkick-4.1.0
- old
+ new
@@ -257,10 +257,14 @@
def bulk_indexer
@bulk_indexer ||= BulkIndexer.new(self)
end
+ def import_before_promotion(index, relation, **import_options)
+ index.import_scope(relation, **import_options)
+ end
+
# https://gist.github.com/jarosan/3124884
# http://www.elasticsearch.org/blog/changing-mapping-with-zero-downtime/
def reindex_scope(relation, import: true, resume: false, retain: false, async: false, refresh_interval: nil, scope: nil)
if resume
index_name = all_indices.sort.last
@@ -282,11 +286,10 @@
}
# check if alias exists
alias_exists = alias_exists?
if alias_exists
- # import before promotion
- index.import_scope(relation, **import_options) if import
+ import_before_promotion(index, relation, **import_options) if import
# get existing indices to remove
unless async
promote(index.name, update_refresh_interval: !refresh_interval.nil?)
clean_indices unless retain