Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: unable to reindex documents (#5276)

sinobe3512aa576f
diff --git a/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py b/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py
index c3595ae495a..b7c5c96a7df 100644
--- a/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py
+++ b/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py
@@ -174,10 +174,15 @@ class WeaviateVector(BaseVector):
schema = self._default_schema(self._collection_name)
if self._client.schema.contains(schema):
for uuid in ids:
- self._client.data_object.delete(
- class_name=self._collection_name,
- uuid=uuid,
- )
+ try:
+ self._client.data_object.delete(
+ 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]:
"""Look up similar documents by embedding vector in Weaviate."""