mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 21:09:06 +08:00
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:
parent
da749c0df2
commit
4f25066aa7
@ -51,6 +51,7 @@ type hybridSearchTask struct {
|
|||||||
|
|
||||||
multipleRecallResults *typeutil.ConcurrentSet[*milvuspb.SearchResults]
|
multipleRecallResults *typeutil.ConcurrentSet[*milvuspb.SearchResults]
|
||||||
reScorers []reScorer
|
reScorers []reScorer
|
||||||
|
rankParams *rankParams
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *hybridSearchTask) PreExecute(ctx context.Context) error {
|
func (t *hybridSearchTask) PreExecute(ctx context.Context) error {
|
||||||
@ -250,13 +251,13 @@ func (t *hybridSearchTask) PostExecute(ctx context.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
rankParams, err := parseRankParams(t.request.GetRankParams())
|
t.rankParams, err = parseRankParams(t.request.GetRankParams())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
t.result, err = rankSearchResultData(ctx, 1,
|
t.result, err = rankSearchResultData(ctx, 1,
|
||||||
rankParams,
|
t.rankParams,
|
||||||
primaryFieldSchema.GetDataType(),
|
primaryFieldSchema.GetDataType(),
|
||||||
t.multipleRecallResults.Collect())
|
t.multipleRecallResults.Collect())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -295,6 +296,12 @@ func (t *hybridSearchTask) Requery() error {
|
|||||||
NotReturnAllMeta: t.request.GetNotReturnAllMeta(),
|
NotReturnAllMeta: t.request.GetNotReturnAllMeta(),
|
||||||
ConsistencyLevel: t.request.GetConsistencyLevel(),
|
ConsistencyLevel: t.request.GetConsistencyLevel(),
|
||||||
UseDefaultConsistency: t.request.GetUseDefaultConsistency(),
|
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
|
// TODO:Xige-16 refine the mvcc functionality of hybrid search
|
||||||
|
Loading…
Reference in New Issue
Block a user