未验证 提交 f5a9a90e 编写于 作者: C cai.zhang 提交者: GitHub

Support search with default params (#24516)

Signed-off-by: Ncai.zhang <cai.zhang@zilliz.com>
上级 219cfd36
...@@ -152,13 +152,7 @@ VectorDiskAnnIndex<T>::Query(const DatasetPtr dataset, const SearchInfo& search_ ...@@ -152,13 +152,7 @@ VectorDiskAnnIndex<T>::Query(const DatasetPtr dataset, const SearchInfo& search_
// set search list // set search list
auto search_list_size = GetValueFromConfig<uint32_t>(search_info.search_params_, DISK_ANN_QUERY_LIST); auto search_list_size = GetValueFromConfig<uint32_t>(search_info.search_params_, DISK_ANN_QUERY_LIST);
AssertInfo(search_list_size.has_value(), "param " + std::string(DISK_ANN_QUERY_LIST) + "is empty"); query_config.search_list_size = search_list_size.has_value() ? search_list_size.value() : 0;
query_config.search_list_size = search_list_size.value();
AssertInfo(query_config.search_list_size >= topk, "search_list should be greater than or equal to topk");
AssertInfo(query_config.search_list_size <= std::max(uint32_t(topk * 10), uint32_t(kSearchListMaxValue1)) &&
query_config.search_list_size <= uint32_t(kSearchListMaxValue2),
"search_list should be less than max(topk*10, 200) and less than 65535");
// set beamwidth // set beamwidth
query_config.beamwidth = search_beamwidth_; query_config.beamwidth = search_beamwidth_;
......
...@@ -205,7 +205,7 @@ VectorMemIndex::parse_config(Config& config) { ...@@ -205,7 +205,7 @@ VectorMemIndex::parse_config(Config& config) {
CheckParameter<int>(config, knowhere::indexparam::NBITS, stoi_closure, std::nullopt); CheckParameter<int>(config, knowhere::indexparam::NBITS, stoi_closure, std::nullopt);
/************************** PQ Params *****************************/ /************************** PQ Params *****************************/
CheckParameter<int>(config, knowhere::indexparam::PQ_M, stoi_closure, std::nullopt); // CheckParameter<int>(config, knowhere::indexparam::PQ_M, stoi_closure, std::nullopt);
/************************** HNSW Params *****************************/ /************************** HNSW Params *****************************/
CheckParameter<int>(config, knowhere::indexparam::EFCONSTRUCTION, stoi_closure, std::nullopt); CheckParameter<int>(config, knowhere::indexparam::EFCONSTRUCTION, stoi_closure, std::nullopt);
......
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
# or implied. See the License for the specific language governing permissions and limitations under the License. # or implied. See the License for the specific language governing permissions and limitations under the License.
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
set( KNOWHERE_VERSION v1.3.14 ) set(KNOWHERE_VERSION v1.3.15)
set( KNOWHERE_SOURCE_MD5 "5a6200d57bfd3d525f4988ee8f5b412e" ) set(KNOWHERE_SOURCE_MD5 "e7f0d153d5f60dc95167820d7bd2e478")
if ( DEFINED ENV{MILVUS_KNOWHERE_URL} ) if (DEFINED ENV{MILVUS_KNOWHERE_URL})
set( KNOWHERE_SOURCE_URL "$ENV{MILVUS_KNOWHERE_URL}" ) set(KNOWHERE_SOURCE_URL "$ENV{MILVUS_KNOWHERE_URL}")
else () else ()
set( KNOWHERE_SOURCE_URL set(KNOWHERE_SOURCE_URL
"https://github.com/milvus-io/knowhere/archive/refs/tags/${KNOWHERE_VERSION}.tar.gz" ) "https://github.com/milvus-io/knowhere/archive/refs/tags/${KNOWHERE_VERSION}.tar.gz")
endif () endif ()
macro(build_knowhere) macro(build_knowhere)
......
...@@ -150,7 +150,7 @@ func parseSearchInfo(searchParamsPair []*commonpb.KeyValuePair) (*planpb.QueryIn ...@@ -150,7 +150,7 @@ func parseSearchInfo(searchParamsPair []*commonpb.KeyValuePair) (*planpb.QueryIn
} }
searchParamStr, err := funcutil.GetAttrByKeyFromRepeatedKV(SearchParamsKey, searchParamsPair) searchParamStr, err := funcutil.GetAttrByKeyFromRepeatedKV(SearchParamsKey, searchParamsPair)
if err != nil { if err != nil {
return nil, 0, err searchParamStr = ""
} }
return &planpb.QueryInfo{ return &planpb.QueryInfo{
Topk: queryTopK, Topk: queryTopK,
......
...@@ -1922,6 +1922,7 @@ func TestSearchTask_ErrExecute(t *testing.T) { ...@@ -1922,6 +1922,7 @@ func TestSearchTask_ErrExecute(t *testing.T) {
} }
func TestTaskSearch_parseQueryInfo(t *testing.T) { func TestTaskSearch_parseQueryInfo(t *testing.T) {
Params.InitOnce()
t.Run("parseSearchInfo no error", func(t *testing.T) { t.Run("parseSearchInfo no error", func(t *testing.T) {
var targetOffset int64 = 200 var targetOffset int64 = 200
...@@ -2007,7 +2008,7 @@ func TestTaskSearch_parseQueryInfo(t *testing.T) { ...@@ -2007,7 +2008,7 @@ func TestTaskSearch_parseQueryInfo(t *testing.T) {
{"Invalid_topk_65536", spInvalidTopk65536}, {"Invalid_topk_65536", spInvalidTopk65536},
{"Invalid_topk_plus_offset", spInvalidTopkPlusOffset}, {"Invalid_topk_plus_offset", spInvalidTopkPlusOffset},
{"No_Metric_type", spNoMetricType}, {"No_Metric_type", spNoMetricType},
{"No_search_params", spNoSearchParams}, //{"No_search_params", spNoSearchParams},
{"Invalid_round_decimal", spInvalidRoundDecimal}, {"Invalid_round_decimal", spInvalidRoundDecimal},
{"Invalid_round_decimal_1000", spInvalidRoundDecimal2}, {"Invalid_round_decimal_1000", spInvalidRoundDecimal2},
{"Invalid_offset_not_int", spInvalidOffsetNoInt}, {"Invalid_offset_not_int", spInvalidOffsetNoInt},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册