Skip to content

Commit

Permalink
fix: allow to pass custom options to the reset reindex parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgz committed Aug 2, 2024
1 parent 7594581 commit 2f19fd8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/esse/index/indices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def reset_index(suffix: index_suffix, settings: nil, optimize: true, import: tru
if import
import(**options, suffix: suffix, refresh: refresh)
elsif reindex && (source_indexes = indices_pointing_to_alias).any?
reindex_kwargs = reindex.is_a?(Hash) ? reindex : {}
reindex_kwargs[:wait_for_completion] = true unless reindex_kwargs.key?(:wait_for_completion)
source_indexes.each do |from|
cluster.api.reindex(**options, body: { source: { index: from }, dest: { index: index_name(suffix: suffix) } }, refresh: refresh)
end
Expand Down

0 comments on commit 2f19fd8

Please sign in to comment.