Skip to content

Commit abe2ce4

Browse files
committed
fix: set wait_for_completion=True always in delete_all_documents
Both sync and async delete_all_documents need to wait for completion so documents are actually deleted before the function returns
1 parent 18d2043 commit abe2ce4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • integrations/opensearch/src/haystack_integrations/document_stores/opensearch

integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ def _prepare_delete_all_request(self, *, is_async: bool, refresh: bool) -> dict[
600600
return {
601601
"index": self._index,
602602
"body": {"query": {"match_all": {}}}, # Delete all documents
603-
"wait_for_completion": not is_async, # `True` for sync calls only
603+
"wait_for_completion": True, # Always wait to ensure documents are deleted before returning
604604
"refresh": refresh,
605605
}
606606

0 commit comments

Comments
 (0)