diff --git a/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py b/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py index e9c88274c..768da7528 100644 --- a/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py +++ b/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py @@ -181,6 +181,9 @@ def write_documents(self, documents: List[Document], policy: DuplicatePolicy = D duplicate_errors_ids = [] other_errors = [] for e in errors: + if "create" not in e: + other_errors.append(e) + continue error_type = e["create"]["error"]["type"] if policy == DuplicatePolicy.FAIL and error_type == "version_conflict_engine_exception": duplicate_errors_ids.append(e["create"]["_id"])