Skip to content

Commit

Permalink
add qdrant metadata.doc_id index when create qdrant collection (#4570)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong authored May 23, 2024
1 parent 233c415 commit 2462449
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/core/rag/datasource/vdb/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ class Field(Enum):
VECTOR = "vector"
TEXT_KEY = "text"
PRIMARY_KEY = "id"
DOC_ID = "metadata.doc_id"
5 changes: 4 additions & 1 deletion api/core/rag/datasource/vdb/qdrant/qdrant_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2462449

Please sign in to comment.