Skip to content
Prev Previous commit
Next Next commit
Qdrant Vector length
Signed-off-by: jyejare <jyejare@redhat.com>
  • Loading branch information
jyejare committed Apr 21, 2025
commit f4118dc674ed4f8c73dd025d8f739f4db50269dc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
from feast.repo_config import FeastConfigBaseModel
from feast.utils import _build_retrieve_online_document_record, to_naive_utc
from feast.utils import _build_retrieve_online_document_record, to_naive_utc, _get_feature_view_vector_field_metadata

SCROLL_SIZE = 1000

Expand Down Expand Up @@ -198,13 +198,15 @@ def create_collection(self, config: RepoConfig, table: FeatureView):
table: FeatureView table for which the index needs to be created.
"""

vector_field_length = _get_feature_view_vector_field_metadata(table) or 512

client: QdrantClient = self._get_client(config)

client.create_collection(
collection_name=table.name,
vectors_config={
config.online_store.vector_name: models.VectorParams(
size=config.online_store.vector_len,
size=vector_field_length,
distance=DISTANCE_MAPPING[config.online_store.similarity.lower()],
)
},
Expand Down