mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 06:55:53 +08:00
fix: unable to reindex documents (#5276)
This commit is contained in:
parent
cc4a4ec796
commit
be3512aa57
@ -174,10 +174,15 @@ class WeaviateVector(BaseVector):
|
|||||||
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:
|
for uuid in ids:
|
||||||
self._client.data_object.delete(
|
try:
|
||||||
class_name=self._collection_name,
|
self._client.data_object.delete(
|
||||||
uuid=uuid,
|
class_name=self._collection_name,
|
||||||
)
|
uuid=uuid,
|
||||||
|
)
|
||||||
|
except weaviate.UnexpectedStatusCodeException as e:
|
||||||
|
# tolerate not found error
|
||||||
|
if e.status_code != 404:
|
||||||
|
raise e
|
||||||
|
|
||||||
def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Document]:
|
def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Document]:
|
||||||
"""Look up similar documents by embedding vector in Weaviate."""
|
"""Look up similar documents by embedding vector in Weaviate."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user