From 993051bb497e2d5a2605784e6d5182ce2510b033 Mon Sep 17 00:00:00 2001 From: aoiasd <45024769+aoiasd@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:58:31 +0800 Subject: [PATCH] fix: brute force bm25 search lack avgdl param (#37650) relate: https://github.com/milvus-io/milvus/issues/35853 Signed-off-by: aoiasd --- internal/core/src/query/SearchBruteForce.cpp | 4 ++++ internal/querynodev2/delegator/util.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/core/src/query/SearchBruteForce.cpp b/internal/core/src/query/SearchBruteForce.cpp index b5f112c5b9da3..2725fcf98a2e5 100644 --- a/internal/core/src/query/SearchBruteForce.cpp +++ b/internal/core/src/query/SearchBruteForce.cpp @@ -59,6 +59,10 @@ PrepareBFSearchParams(const SearchInfo& search_info) { search_info.trace_ctx_.traceFlags; } + if (search_info.metric_type_ == knowhere::metric::BM25) { + search_cfg[knowhere::meta::BM25_AVGDL] = + search_info.search_params_[knowhere::meta::BM25_AVGDL]; + } return search_cfg; } diff --git a/internal/querynodev2/delegator/util.go b/internal/querynodev2/delegator/util.go index 8c9f74b3ab419..b9560554e9222 100644 --- a/internal/querynodev2/delegator/util.go +++ b/internal/querynodev2/delegator/util.go @@ -56,7 +56,7 @@ func SetBM25Params(req *internalpb.SearchRequest, avgdl float64) error { return merr.WrapErrParameterInvalid("marshalable search plan", "plan with marshal error", err.Error()) } req.SerializedExprPlan = serializedExprPlan - log.Debug("optimized search params done", zap.Any("queryInfo", queryInfo)) + log.Debug("add bm25 avgdl to search params done", zap.Any("queryInfo", queryInfo)) default: log.Warn("not supported node type", zap.String("nodeType", fmt.Sprintf("%T", plan.GetNode()))) }