未验证 提交 31365876 编写于 作者: Y yukun 提交者: GitHub

Add field_name and type in retrieve result (#5665)

Signed-off-by: Nfishpenguin <kun.yu@zilliz.com>
上级 7d286ebc
......@@ -1612,7 +1612,7 @@ func (rt *RetrieveTask) PostExecute(ctx context.Context) error {
availableQueryNodeNum := 0
rt.result = &milvuspb.RetrieveResults{
Status: &commonpb.Status{
ErrorCode: 0,
ErrorCode: commonpb.ErrorCode_Success,
},
Ids: &schemapb.IDs{},
FieldsData: make([]*schemapb.FieldData, 0),
......@@ -1650,8 +1650,8 @@ func (rt *RetrieveTask) PostExecute(ctx context.Context) error {
},
}
}
}
rt.result.FieldsData = append(rt.result.FieldsData, partialRetrieveResult.FieldsData...)
}
availableQueryNodeNum++
......@@ -1668,6 +1668,19 @@ func (rt *RetrieveTask) PostExecute(ctx context.Context) error {
}
return nil
}
schema, err := globalMetaCache.GetCollectionSchema(ctx, rt.retrieve.CollectionName)
if err != nil {
return err
}
for i := 0; i < len(rt.result.FieldsData); i++ {
for _, field := range schema.Fields {
if field.Name == rt.OutputFields[i] {
rt.result.FieldsData[i].FieldName = field.Name
rt.result.FieldsData[i].Type = field.DataType
}
}
}
}
log.Info("Retrieve PostExecute done.",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册