From 546277c3cf4b44ab326e259e2c613eedc5000fa2 Mon Sep 17 00:00:00 2001
From: Damien DESPRES <ext.neogeo.ddespres@grandlyon.com>
Date: Tue, 14 Dec 2021 16:29:03 +0000
Subject: [PATCH] migration es7

---
 workers/sample_generator.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/workers/sample_generator.py b/workers/sample_generator.py
index 82dd4e9..88f7741 100644
--- a/workers/sample_generator.py
+++ b/workers/sample_generator.py
@@ -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
-- 
GitLab