Solution:
Reference:
Hi @HenningAndersen ,
So _delete_by_query basically searches for the documents to delete and then deletes them one by one. And a version conflict occurs if one or more of the documents gets update in between the time when the search was completed and the delete operation was started.
But as I said, I had received a successful created/updated response for all the documents that have to deleted, before sending the _delete_by_query request. And I am pretty sure that that none of the documents are …
I made this change to my python code and it worked:
I added self.es.indices.refresh(index = i)
if self.es.indices.exists(index = i):
for q in queries:
self.es.indices.refresh(index = i)
self.es.update_by_query(index = i, body = q)