mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
enhance: Add primary field name in SearchResult and QueryResults (#39220)
issue: https://github.com/milvus-io/milvus/issues/39219 Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
This commit is contained in:
parent
d6f4348965
commit
ecc2d80915
@ -12,9 +12,7 @@ require (
|
||||
github.com/samber/lo v1.27.0
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/tidwall/gjson v1.17.1
|
||||
go.opentelemetry.io/otel v1.28.0
|
||||
go.uber.org/atomic v1.11.0
|
||||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
|
||||
google.golang.org/grpc v1.65.0
|
||||
google.golang.org/protobuf v1.34.2
|
||||
)
|
||||
@ -89,6 +87,7 @@ require (
|
||||
go.etcd.io/etcd/raft/v3 v3.5.5 // indirect
|
||||
go.etcd.io/etcd/server/v3 v3.5.5 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
|
||||
go.opentelemetry.io/otel v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.28.0 // indirect
|
||||
@ -99,6 +98,7 @@ require (
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
golang.org/x/crypto v0.31.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
|
||||
golang.org/x/net v0.33.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/sys v0.28.0 // indirect
|
||||
|
||||
@ -562,6 +562,12 @@ func (t *queryTask) PostExecute(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
t.result.OutputFields = t.userOutputFields
|
||||
primaryFieldSchema, err := t.schema.GetPkField()
|
||||
if err != nil {
|
||||
log.Warn("failed to get primary field schema", zap.Error(err))
|
||||
return err
|
||||
}
|
||||
t.result.PrimaryFieldName = primaryFieldSchema.GetName()
|
||||
metrics.ProxyReduceResultLatency.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), metrics.QueryLabel).Observe(float64(tr.RecordSpan().Milliseconds()))
|
||||
|
||||
if t.queryParams.isIterator && t.request.GetGuaranteeTimestamp() == 0 {
|
||||
|
||||
@ -849,6 +849,7 @@ func (t *searchTask) PostExecute(ctx context.Context) error {
|
||||
}
|
||||
t.result.Results.FieldsData = append(t.result.Results.FieldsData, pkFieldData)
|
||||
}
|
||||
t.result.Results.PrimaryFieldName = primaryFieldSchema.GetName()
|
||||
if t.isIterator && len(t.queryInfos) == 1 && t.queryInfos[0] != nil {
|
||||
if iterInfo := t.queryInfos[0].GetSearchIteratorV2Info(); iterInfo != nil {
|
||||
t.result.Results.SearchIteratorV2Results = &schemapb.SearchIteratorV2Results{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user