Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ElasticSearch vector length
Signed-off-by: jyejare <jyejare@redhat.com>
  • Loading branch information
jyejare committed Apr 21, 2025
commit bdcc7594b26f1234bb782b9c415561b6395edccc
2 changes: 1 addition & 1 deletion docs/reference/online-stores/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Currently, the indexing mapping in the ElasticSearch online store is configured
"created_ts": {"type": "date"},
"vector_value": {
"type": "dense_vector",
"dims": config.online_store.vector_len,
"dims": vector_field_length,
"index": "true",
"similarity": config.online_store.similarity,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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


class ElasticSearchOnlineStoreConfig(FeastConfigBaseModel, VectorStoreConfig):
Expand Down Expand Up @@ -161,6 +161,8 @@ def create_index(self, config: RepoConfig, table: FeatureView):
config: Feast repo configuration object.
table: FeatureView table for which the index needs to be created.
"""
vector_field_length = _get_feature_view_vector_field_metadata(table).vector_len or 512

index_mapping = {
"properties": {
"entity_key": {"type": "binary"},
Expand All @@ -170,7 +172,7 @@ def create_index(self, config: RepoConfig, table: FeatureView):
"created_ts": {"type": "date"},
"vector_value": {
"type": "dense_vector",
"dims": config.online_store.vector_len,
"dims": vector_field_length,
"index": "true",
"similarity": config.online_store.similarity,
},
Expand Down