From 86509161b0250964051e6075427db4ed4a935304 Mon Sep 17 00:00:00 2001 From: Dan <38852336+SebanDan@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:55:06 +0200 Subject: [PATCH] community: fix AzureSearch delete documents (#22315) **Description** Fix AzureSearch delete documents method by using FIELDS_ID variable instead of the hard coded "id" value **Issue:** This is linked to this issue: https://github.com/langchain-ai/langchain/issues/22314 Co-authored-by: dseban --- libs/community/langchain_community/vectorstores/azuresearch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/community/langchain_community/vectorstores/azuresearch.py b/libs/community/langchain_community/vectorstores/azuresearch.py index 1ba6bbf1b80..29177043cf3 100644 --- a/libs/community/langchain_community/vectorstores/azuresearch.py +++ b/libs/community/langchain_community/vectorstores/azuresearch.py @@ -401,7 +401,7 @@ class AzureSearch(VectorStore): False otherwise. """ if ids: - res = self.client.delete_documents([{"id": i} for i in ids]) + res = self.client.delete_documents([{FIELDS_ID: i} for i in ids]) return len(res) > 0 else: return False