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.

add qdrant metadata.doc_id index when create qdrant collection (#4570)

Jyong24624491cd96
diff --git a/api/core/rag/datasource/vdb/field.py b/api/core/rag/datasource/vdb/field.py
index dc400dafbb0..1c16e4d9cda 100644
--- a/api/core/rag/datasource/vdb/field.py
+++ b/api/core/rag/datasource/vdb/field.py
@@ -8,3 +8,4 @@ class Field(Enum):
VECTOR = "vector"
TEXT_KEY = "text"
PRIMARY_KEY = "id"
+ DOC_ID = "metadata.doc_id"
diff --git a/api/core/rag/datasource/vdb/qdrant/qdrant_vector.py b/api/core/rag/datasource/vdb/qdrant/qdrant_vector.py
index e6e83c66d84..7a92314542f 100644
--- a/api/core/rag/datasource/vdb/qdrant/qdrant_vector.py
+++ b/api/core/rag/datasource/vdb/qdrant/qdrant_vector.py
@@ -115,9 +115,12 @@ class QdrantVector(BaseVector):
timeout=int(self._client_config.timeout),
)
- # create payload index
+ # create group_id payload index
self._client.create_payload_index(collection_name, Field.GROUP_KEY.value,
field_schema=PayloadSchemaType.KEYWORD)
+ # create doc_id payload index
+ self._client.create_payload_index(collection_name, Field.DOC_ID.value,
+ field_schema=PayloadSchemaType.KEYWORD)
# creat full text index
text_index_params = TextIndexParams(
type=TextIndexType.TEXT,