fix: Fix requery without limit during HybridSearch (#30220)

issue: #29990 

/kind bug

Signed-off-by: xige-16 <xi.ge@zilliz.com>

Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
xige-16 2024-01-25 11:03:00 +08:00 committed by GitHub
parent da749c0df2
commit 4f25066aa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,7 @@ type hybridSearchTask struct {
multipleRecallResults *typeutil.ConcurrentSet[*milvuspb.SearchResults]
reScorers []reScorer
rankParams *rankParams
}
func (t *hybridSearchTask) PreExecute(ctx context.Context) error {
@ -250,13 +251,13 @@ func (t *hybridSearchTask) PostExecute(ctx context.Context) error {
return err
}
rankParams, err := parseRankParams(t.request.GetRankParams())
t.rankParams, err = parseRankParams(t.request.GetRankParams())
if err != nil {
return err
}
t.result, err = rankSearchResultData(ctx, 1,
rankParams,
t.rankParams,
primaryFieldSchema.GetDataType(),
t.multipleRecallResults.Collect())
if err != nil {
@ -295,6 +296,12 @@ func (t *hybridSearchTask) Requery() error {
NotReturnAllMeta: t.request.GetNotReturnAllMeta(),
ConsistencyLevel: t.request.GetConsistencyLevel(),
UseDefaultConsistency: t.request.GetUseDefaultConsistency(),
QueryParams: []*commonpb.KeyValuePair{
{
Key: LimitKey,
Value: strconv.FormatInt(t.rankParams.limit, 10),
},
},
}
// TODO:Xige-16 refine the mvcc functionality of hybrid search