Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 19 additions & 1 deletion integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
GenerativeSearches,
Property,
ReferenceProperty,
VectorDistances,
Vectorizers,
_CollectionConfig,
)
Expand Down Expand Up @@ -302,7 +303,24 @@ def test_create_export_and_recreate_named_vectors(
source_properties=["name"],
vectorize_collection_name=False,
),
Configure.NamedVectors.none("custom", vector_index_config=Configure.VectorIndex.flat()),
Configure.NamedVectors.none(
"custom",
vector_index_config=Configure.VectorIndex.flat(
distance_metric=VectorDistances.DOT
),
),
Configure.NamedVectors.none(
"hnsw",
vector_index_config=Configure.VectorIndex.hnsw(
distance_metric=VectorDistances.DOT
),
),
Configure.NamedVectors.none(
"dynamic",
vector_index_config=Configure.VectorIndex.dynamic(
distance_metric=VectorDistances.DOT
),
),
],
)
conf = col.config.get()
Expand Down
2 changes: 1 addition & 1 deletion integration/test_collection_hfresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_collection_config_hfresh(collection_factory: CollectionFactory) -> None

collection = collection_factory(
vector_index_config=Configure.VectorIndex.hfresh(
distance_metric=VectorDistances.COSINE,
distance_metric=VectorDistances.DOT,
max_posting_size_kb=1024,
replicas=2,
search_probe=50,
Expand Down
6 changes: 6 additions & 0 deletions weaviate/collections/classes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,7 @@ class _VectorIndexConfig(_ConfigBase):

def to_dict(self) -> Dict[str, Any]:
out = super().to_dict()
out["distance"] = out.pop("distanceMetric")
if isinstance(self.quantizer, _PQConfig):
out["pq"] = {**out.pop("quantizer"), "enabled": True}
elif isinstance(self.quantizer, _BQConfig):
Expand Down Expand Up @@ -2213,6 +2214,11 @@ class _VectorIndexConfigDynamic(_ConfigBase):
def vector_index_type() -> str:
return VectorIndexType.DYNAMIC.value

def to_dict(self) -> Dict[str, Any]:
out = super().to_dict()
out["distance"] = out.pop("distanceMetric")
return out


VectorIndexConfigDynamic = _VectorIndexConfigDynamic

Expand Down
Loading