fix weaviate delete issue

This commit is contained in:
jyong 2025-03-18 16:29:59 +08:00
parent d57c82bfa8
commit 7dbbb277e6

View File

@ -168,11 +168,11 @@ class WeaviateVector(BaseVector):
# check whether the index already exists # check whether the index already exists
schema = self._default_schema(self._collection_name) schema = self._default_schema(self._collection_name)
if self._client.schema.contains(schema): if self._client.schema.contains(schema):
for uuid in ids:
try: try:
self._client.batch.delete_objects( self._client.data_object.delete(
class_name=self._collection_name, class_name=self._collection_name,
where={"operator": "ContainsAny", "path": ["id"], "valueTextArray": ids}, uuid=uuid,
output="minimal",
) )
except weaviate.UnexpectedStatusCodeException as e: except weaviate.UnexpectedStatusCodeException as e:
# tolerate not found error # tolerate not found error