From d0b0c4bbe990b6a3883176dc02e46a96c1ac18ee Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Wed, 14 Dec 2022 10:17:19 +0800 Subject: [PATCH] Add search_k scope to k ~ MAX_INT64 for ANNOY (#601) Signed-off-by: yudong.cai Signed-off-by: yudong.cai --- knowhere/index/vector_index/ConfAdapter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/knowhere/index/vector_index/ConfAdapter.cpp b/knowhere/index/vector_index/ConfAdapter.cpp index 6ad68d41a..b5e774d4a 100644 --- a/knowhere/index/vector_index/ConfAdapter.cpp +++ b/knowhere/index/vector_index/ConfAdapter.cpp @@ -271,9 +271,8 @@ ANNOYConfAdapter::CheckTrain(Config& cfg, const IndexMode mode) { bool ANNOYConfAdapter::CheckSearch(Config& cfg, const IndexType type, const IndexMode mode) { - static int64_t MIN_SEARCH_K = std::numeric_limits::min(); static int64_t MAX_SEARCH_K = std::numeric_limits::max(); - CheckIntegerRange(cfg, indexparam::SEARCH_K, MIN_SEARCH_K, MAX_SEARCH_K); + CheckIntegerRange(cfg, indexparam::SEARCH_K, GetMetaTopk(cfg), MAX_SEARCH_K); return ConfAdapter::CheckSearch(cfg, type, mode); }