diff --git a/python/tests/test_params.py b/python/tests/test_params.py index b067a25..0a85a7a 100644 --- a/python/tests/test_params.py +++ b/python/tests/test_params.py @@ -82,7 +82,7 @@ class TestHnswIndexParam: def test_default(self): param = HnswIndexParam() assert param.metric_type == MetricType.IP - assert param.m == 100 + assert param.m == 50 assert param.ef_construction == 500 assert param.quantize_type == QuantizeType.UNDEFINED assert param.type == IndexType.HNSW diff --git a/python/tests/test_schema.py b/python/tests/test_schema.py index f828d73..4a4e1a5 100644 --- a/python/tests/test_schema.py +++ b/python/tests/test_schema.py @@ -165,7 +165,7 @@ def test_collection_schema_with_single_field(self): assert vector.data_type == DataType.VECTOR_INT8 assert vector.dimension == 128 assert vector.index_param.type == IndexType.HNSW - assert vector.index_param.m == 100 + assert vector.index_param.m == 50 assert vector.index_param.ef_construction == 500 assert vector.index_param.metric_type == MetricType.IP diff --git a/python/zvec/model/param/__init__.pyi b/python/zvec/model/param/__init__.pyi index a1a9dcc..ea2f34e 100644 --- a/python/zvec/model/param/__init__.pyi +++ b/python/zvec/model/param/__init__.pyi @@ -189,7 +189,7 @@ class HnswIndexParam(VectorIndexParam): Default is ``MetricType.IP`` (inner product). m (int): Number of bi-directional links created for every new element during construction. Higher values improve accuracy but increase - memory usage and construction time. Default is 100. + memory usage and construction time. Default is 50. ef_construction (int): Size of the dynamic candidate list for nearest neighbors during index construction. Larger values yield better graph quality at the cost of slower build time. Default is 500. @@ -272,7 +272,7 @@ class HnswQueryParam(QueryParam): Args: ef (int, optional): Search-time candidate list size. - Higher values improve accuracy. Defaults to 100. + Higher values improve accuracy. Defaults to 300. radius (float, optional): Search radius for range queries. Default is 0.0. is_linear (bool, optional): Force linear search. Default is False. is_using_refiner (bool, optional): Whether to use refiner for the query. Default is False. diff --git a/src/core/interface/constants.h b/src/core/interface/constants.h index aeb941a..4efcdfa 100644 --- a/src/core/interface/constants.h +++ b/src/core/interface/constants.h @@ -5,7 +5,7 @@ namespace zvec::core_interface { constexpr static uint32_t kDefaultHnswEfConstruction = 500; -constexpr static uint32_t kDefaultHnswNeighborCnt = 100; +constexpr static uint32_t kDefaultHnswNeighborCnt = 50; constexpr static uint32_t kDefaultHnswEfSearch = 300;