Commit 546277c3 authored by Damien DESPRES's avatar Damien DESPRES
Browse files

migration es7

parent 0039dfe8
Pipeline #18701 passed with stages
in 20 seconds
......@@ -40,7 +40,7 @@ def callback(channel, method, properties, body):
the_query['query'] = dict()
the_query['query']['term'] = {'uuid.keyword': uuid}
res = source_es.search(cfg['reindexer']['source_index'], '_doc', the_query)
res = source_es.search(index=cfg['reindexer']['source_index'], doc_type='_doc', body=the_query)
docs_to_index = [ doc['_source'] for doc in res['hits']['hits'] ]
......@@ -61,7 +61,7 @@ def callback(channel, method, properties, body):
logging.info("Deleting already existing samples for dataset with slug = %s" % docs_to_index[0]['slug'])
try:
res = destin_es.delete_by_query(cfg['reindexer']['destination_index'], doc_type='_doc', body=the_query, conflicts='proceed', refresh=True, wait_for_completion=False)
res = destin_es.delete_by_query(index=cfg['reindexer']['destination_index'], doc_type='_doc', body=the_query, conflicts='proceed', refresh=True, wait_for_completion=False)
logging.debug(res)
task_id = res['task']
# wait until ES is done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment