Skip to content

Commit

Permalink
fix: keep inner topK to avoid exceeding efSearch (#36287)
Browse files Browse the repository at this point in the history
issue :#36243
pr : #36284

Signed-off-by: zhenshan.cao <[email protected]>
  • Loading branch information
czs007 authored Sep 15, 2024
1 parent 2df9309 commit 2bc454b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions internal/proxy/search_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ func parseSearchInfo(searchParamsPair []*commonpb.KeyValuePair, schema *schemapb
}
topK = externalLimit
} else {
if topKInParam < externalLimit {
topK = externalLimit
} else {
topK = topKInParam
}
topK = topKInParam
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/task_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,7 @@ func TestTaskSearch_parseSearchInfo(t *testing.T) {
info, offset, err := parseSearchInfo(offsetParam, nil, rank)
assert.NoError(t, err)
assert.NotNil(t, info)
assert.Equal(t, externalLimit, info.GetTopk())
assert.Equal(t, int64(10), info.GetTopk())
assert.Equal(t, int64(0), offset)
})

Expand Down

0 comments on commit 2bc454b

Please sign in to comment.