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

This commit is contained in:
Jyong 2024-05-23 18:11:01 +08:00 committed by GitHub
parent 233c4150d1
commit 24624491cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -8,3 +8,4 @@ class Field(Enum):
VECTOR = "vector"
TEXT_KEY = "text"
PRIMARY_KEY = "id"
DOC_ID = "metadata.doc_id"

View File

@ -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,