Skip to content

Commit

Permalink
fixed rest.action.multi.allow_explicit_index: false
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunihiko Kido committed Jun 3, 2015
1 parent af65f55 commit 3327cdb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Lib/elasticsearch/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def change_index(hits, index):
def expand_action(data):
data = data.copy()
action = {'index': {}}
for key in ('_index', '_parent', '_percolate', '_routing', '_timestamp',
for key in ('_parent', '_percolate', '_routing', '_timestamp',
'_ttl', '_type', '_version', '_version_type', '_id',
'_retry_on_conflict'):
if key in data:
Expand Down Expand Up @@ -108,7 +108,8 @@ def reindex(client, source_index, target_index, query=None, target_client=None,
scroll=scroll, **scan_kwargs)

success, failed = bulk_index(
target_client, change_index(docs, target_index), chunk_size=chunk_size)
target_client, change_index(docs, target_index),
chunk_size=chunk_size, index=target_index)

result['success'] = success
result['failed'] = failed
Expand Down Expand Up @@ -158,7 +159,8 @@ def loaddata(inputfile, client, index, chunk_size=500, command=None):
sublime.status_message("read: {}".format(len(docs)))

success, failed = bulk_index(
client, change_index(docs, index), chunk_size=chunk_size)
client, change_index(docs, index), chunk_size=chunk_size,
index=index)

result['success'] = success
result['failed'] = failed
Expand Down

0 comments on commit 3327cdb

Please sign in to comment.