Skip to content
Snippets Groups Projects
Commit 546277c3 authored by Damien DESPRES's avatar Damien DESPRES
Browse files

migration es7

parent 0039dfe8
Branches
Tags
1 merge request!23merge dev into master
Pipeline #18701 passed
...@@ -40,7 +40,7 @@ def callback(channel, method, properties, body): ...@@ -40,7 +40,7 @@ def callback(channel, method, properties, body):
the_query['query'] = dict() the_query['query'] = dict()
the_query['query']['term'] = {'uuid.keyword': uuid} 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'] ] docs_to_index = [ doc['_source'] for doc in res['hits']['hits'] ]
...@@ -61,7 +61,7 @@ def callback(channel, method, properties, body): ...@@ -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']) logging.info("Deleting already existing samples for dataset with slug = %s" % docs_to_index[0]['slug'])
try: 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) logging.debug(res)
task_id = res['task'] task_id = res['task']
# wait until ES is done # wait until ES is done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment