fix: brute force bm25 search lack avgdl param (#37650)

relate: https://github.com/milvus-io/milvus/issues/35853

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
aoiasd 2024-11-14 14:58:31 +08:00 committed by GitHub
parent 31a8d08bdd
commit 993051bb49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -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;
}

View File

@ -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())))
}