diff --git a/api/core/rag/datasource/vdb/field.py b/api/core/rag/datasource/vdb/field.py index dc400dafbb0467..1c16e4d9cdacde 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 e6e83c66d84f73..7a92314542ffbb 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 @@ def create_collection(self, collection_name: str, vector_size: int): 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,