Fill outputFields for query/search result (#24352)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/24368/head
cai.zhang 2023-05-25 11:39:26 +08:00 committed by GitHub
parent 49f75e5e11
commit 59b0a61cb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 6 deletions

View File

@ -2782,15 +2782,10 @@ func (node *Proxy) Query(ctx context.Context, request *milvuspb.QueryRequest) (*
metrics.QueryLabel).Observe(float64(tr.ElapseSpan().Milliseconds()))
metrics.ProxyCollectionSQLatency.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10),
metrics.QueryLabel, request.CollectionName).Observe(float64(tr.ElapseSpan().Milliseconds()))
ret := &milvuspb.QueryResults{
Status: qt.result.Status,
FieldsData: qt.result.FieldsData,
}
sentSize := proto.Size(qt.result)
rateCol.Add(metricsinfo.ReadResultThroughput, float64(sentSize))
metrics.ProxyReadReqSendBytes.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10)).Add(float64(sentSize))
return ret, nil
return qt.result, nil
}
// CreateAlias create alias for collection, then you can search the collection with alias.

View File

@ -452,6 +452,7 @@ func (t *queryTask) PostExecute(ctx context.Context) error {
if err != nil {
return err
}
t.result.OutputFields = t.userOutputFields
metrics.ProxyReduceResultLatency.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), metrics.QueryLabel).Observe(float64(tr.RecordSpan().Milliseconds()))
log.Debug("Query PostExecute done")

View File

@ -453,6 +453,7 @@ func (t *searchTask) PostExecute(ctx context.Context) error {
return err
}
}
t.result.Results.OutputFields = t.userOutputFields
log.Ctx(ctx).Debug("Search post execute done",
zap.Int64("collection", t.GetCollectionID()),