fix: Check parse QueryInfo error before using it (#31836)

See also milvus-io/milvus-sdk-go#693 #31735

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/31873/head
congqixia 2024-04-03 11:29:14 +08:00 committed by GitHub
parent 3b5209c460
commit 1af2ee903c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -77,6 +77,9 @@ func initSearchRequest(ctx context.Context, t *searchTask, isHybrid bool) error
annsFieldName = vecFields[0].Name
}
queryInfo, offset, err := parseSearchInfo(t.request.GetSearchParams(), t.schema.CollectionSchema)
if err != nil {
return err
}
annField := typeutil.GetFieldByName(t.schema.CollectionSchema, annsFieldName)
if queryInfo.GetGroupByFieldId() != -1 && isHybrid {
return errors.New("not support search_group_by operation in the hybrid search")
@ -85,9 +88,6 @@ func initSearchRequest(ctx context.Context, t *searchTask, isHybrid bool) error
return errors.New("not support search_group_by operation based on binary vector column")
}
if err != nil {
return err
}
t.offset = offset
plan, err := planparserv2.CreateSearchPlan(t.schema.schemaHelper, t.request.Dsl, annsFieldName, queryInfo)