Skip to content

Commit

Permalink
fix: brute force bm25 search lack avgdl param (#37650)
Browse files Browse the repository at this point in the history
relate: #35853

Signed-off-by: aoiasd <[email protected]>
  • Loading branch information
aoiasd authored Nov 14, 2024
1 parent 31a8d08 commit 993051b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/core/src/query/SearchBruteForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion internal/querynodev2/delegator/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())))
}
Expand Down

0 comments on commit 993051b

Please sign in to comment.