Skip to content

Commit

Permalink
fix: Pass offset param in rerank params for HybridSearch
Browse files Browse the repository at this point in the history
See also milvus-io/milvus#32562

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Apr 26, 2024
1 parent 41f8c8d commit ddc5800
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions client/reranker.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
)

type Reranker interface {
WithOffset(offset int64)
GetParams() []*commonpb.KeyValuePair
}

Expand Down

0 comments on commit ddc5800

Please sign in to comment.