delete the deprecated method (#5612)

This commit is contained in:
Jyong
2024-06-26 12:51:50 +08:00
committed by GitHub
parent af6e3869ff
commit 43335b5c87
19 changed files with 24 additions and 87 deletions

View File

@@ -87,11 +87,6 @@ class OpenSearchVector(BaseVector):
helpers.bulk(self._client, actions)
def delete_by_document_id(self, document_id: str):
ids = self.get_ids_by_metadata_field('document_id', document_id)
if ids:
self.delete_by_ids(ids)
def get_ids_by_metadata_field(self, key: str, value: str):
query = {"query": {"term": {f"{Field.METADATA_KEY.value}.{key}": value}}}
response = self._client.search(index=self._collection_name.lower(), body=query)