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 <dan.seban@neoxia.com>
This commit is contained in:
Dan
2024-06-03 17:55:06 +02:00
committed by GitHub
parent 8fad2e209a
commit 86509161b0

View File

@@ -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