enhance: add channel num for queryHook optimization (#35105)

pr: #35104

Signed-off-by: chasingegg <chao.gao@zilliz.com>
This commit is contained in:
Gao 2024-07-31 18:23:51 +08:00 committed by GitHub
parent f8f2736cda
commit be0123863f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,9 @@ func OptimizeSearchParams(ctx context.Context, req *querypb.SearchRequest, query
common.WithOptimizeKey: paramtable.Get().AutoIndexConfig.EnableOptimize.GetAsBool(),
common.CollectionKey: req.GetReq().GetCollectionID(),
}
if withFilter && channelNum > 1 {
params[common.ChannelNumKey] = channelNum
}
err := queryHook.Run(params)
if err != nil {
log.Warn("failed to execute queryHook", zap.Error(err))

View File

@ -109,6 +109,7 @@ const (
SegmentNumKey = "segment_num"
WithFilterKey = "with_filter"
DataTypeKey = "data_type"
ChannelNumKey = "channel_num"
WithOptimizeKey = "with_optimize"
CollectionKey = "collection"