Skip to content

Commit e43fe1e

Browse files
committed
Maintain _id when copying index
1 parent fb8268e commit e43fe1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/es/utils.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def self.copy_index(from_index, to_index, opts = {})
1010

1111
while results['hits']['hits'].any?
1212
requests = results['hits']['hits'].each_with_object([]) do |hit, requests|
13-
requests << {index: {_type: hit['_type'], _id: hit['id']}}
13+
requests << {index: {_type: hit['_type'], _id: hit['_id']}}
1414
requests << hit['_source']
1515
end
1616

@@ -20,4 +20,4 @@ def self.copy_index(from_index, to_index, opts = {})
2020
results = from.scroll(scroll: scroll_timeout, scroll_id: scroll_id)
2121
end
2222
end
23-
end
23+
end

0 commit comments

Comments
 (0)