mirror of https://github.com/milvus-io/milvus.git
Refine NQ check logic (#19819)
issue: #19682 /kind improvement Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com> Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>pull/19815/head
parent
40091392f0
commit
a4a6f60279
|
@ -259,12 +259,6 @@ func (t *searchTask) PreExecute(ctx context.Context) error {
|
|||
sp, ctx := trace.StartSpanFromContextWithOperationName(t.TraceCtx(), "Proxy-Search-PreExecute")
|
||||
defer sp.Finish()
|
||||
|
||||
// Check the nq is valid:
|
||||
// https://milvus.io/docs/limitations.md
|
||||
if err := validateLimit(t.request.GetNq()); err != nil {
|
||||
return fmt.Errorf("%s [%d] is invalid, %w", NQKey, t.request.GetNq(), err)
|
||||
}
|
||||
|
||||
if t.searchShardPolicy == nil {
|
||||
t.searchShardPolicy = mergeRoundRobinPolicy
|
||||
}
|
||||
|
@ -369,10 +363,16 @@ func (t *searchTask) PreExecute(ctx context.Context) error {
|
|||
|
||||
t.SearchRequest.Dsl = t.request.Dsl
|
||||
t.SearchRequest.PlaceholderGroup = t.request.PlaceholderGroup
|
||||
// Manually update nq if not set.
|
||||
nq, err := getNq(t.request)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Check if nq is valid:
|
||||
// https://milvus.io/docs/limitations.md
|
||||
if err := validateLimit(nq); err != nil {
|
||||
return fmt.Errorf("%s [%d] is invalid, %w", NQKey, nq, err)
|
||||
}
|
||||
t.SearchRequest.Nq = nq
|
||||
|
||||
log.Ctx(ctx).Debug("search PreExecute done.", zap.Int64("msgID", t.ID()),
|
||||
|
|
Loading…
Reference in New Issue