Skip to content

Commit

Permalink
Fix refresh behaviour for Elasticsearch delete (deepset-ai#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanaysoni authored Feb 1, 2021
1 parent d62355c commit 5bf351e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion haystack/document_store/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,8 @@ def delete_all_documents(self, index: Optional[str] = None, filters: Optional[Di
query["query"] = {"match_all": {}}
self.client.delete_by_query(index=index, body=query, ignore=[404])
# We want to be sure that all docs are deleted before continuing (delete_by_query doesn't support wait_for)
time.sleep(1)
if self.refresh_type == "wait_for":
time.sleep(1)


class OpenDistroElasticsearchDocumentStore(ElasticsearchDocumentStore):
Expand Down

0 comments on commit 5bf351e

Please sign in to comment.