Skip to content

Commit

Permalink
fix: keep inner topK to avoid exceeding efSearch
Browse files Browse the repository at this point in the history
Signed-off-by: zhenshan.cao <[email protected]>
  • Loading branch information
czs007 committed Sep 15, 2024
1 parent 329fb42 commit 7ed7ce4
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 @@ -2258,7 +2258,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 7ed7ce4

Please sign in to comment.