Skip to content

Commit b62b1ac

Browse files
committed
feat: add session params to hnsw config
1 parent 80a5c63 commit b62b1ac

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • vectordb_bench/backend/clients/clickhouse

vectordb_bench/backend/clients/clickhouse/config.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import TypedDict
2+
from abc import abstractmethod
23
from pydantic import BaseModel, SecretStr
4+
35
from ..api import DBConfig, DBCaseConfig, MetricType, IndexType
46

57

@@ -53,6 +55,9 @@ def parse_metric_str(self) -> str:
5355
elif self.metric_type == MetricType.COSINE:
5456
return "cosineDistance"
5557

58+
@abstractmethod
59+
def session_param(self):
60+
pass
5661

5762
class ClickhouseHNSWConfig(ClickhouseIndexConfig):
5863
M: int | None # Default in clickhouse in 32
@@ -64,7 +69,6 @@ class ClickhouseHNSWConfig(ClickhouseIndexConfig):
6469
granularity: int | None = 10_000_000 # Size of the index granules. By default, in CH it's equal 10.000.000
6570

6671
def index_param(self) -> dict:
67-
print(self.M, self.efConstruction)
6872
return {
6973
"vector_data_type": self.vector_data_type,
7074
"metric_type": self.parse_metric_str(),
@@ -79,4 +83,8 @@ def search_param(self) -> dict:
7983
"metric_type": self.parse_metric_str(),
8084
"params": {"ef": self.ef},
8185
}
86+
def session_param(self) -> dict:
87+
return {
88+
'allow_experimental_vector_similarity_index': 1,
89+
}
8290

0 commit comments

Comments
 (0)