From ddc580065bf8b434eb9dfee4b1356e2135142dd8 Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Fri, 26 Apr 2024 10:00:17 +0800 Subject: [PATCH] fix: Pass offset param in rerank params for HybridSearch See also milvus-io/milvus#32562 Signed-off-by: Congqi Xia --- client/data.go | 5 +++++ client/reranker.go | 1 + 2 files changed, 6 insertions(+) diff --git a/client/data.go b/client/data.go index 4cb19b27..62a4e4c4 100644 --- a/client/data.go +++ b/client/data.go @@ -67,8 +67,13 @@ func (c *GrpcClient) HybridSearch(ctx context.Context, collName string, partitio sReqs = append(sReqs, r) } + opt := &SearchQueryOption{} + for _, o := range opts { + o(opt) + } params := reranker.GetParams() params = append(params, &commonpb.KeyValuePair{Key: limitKey, Value: strconv.FormatInt(int64(limit), 10)}) + params = append(params, &commonpb.KeyValuePair{Key: offsetKey, Value: strconv.FormatInt(int64(opt.Offset), 10)}) req := &milvuspb.HybridSearchRequest{ CollectionName: collName, diff --git a/client/reranker.go b/client/reranker.go index ba8a41b8..05fe6e60 100644 --- a/client/reranker.go +++ b/client/reranker.go @@ -17,6 +17,7 @@ const ( ) type Reranker interface { + WithOffset(offset int64) GetParams() []*commonpb.KeyValuePair }