mirror of https://github.com/milvus-io/milvus.git
Fix bug: remove duplicated primary field id when retrieve entities (#6577)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>pull/6598/head
parent
a7856ddeab
commit
2d9361e0ba
|
@ -1420,6 +1420,7 @@ func (st *SearchTask) PreExecute(ctx context.Context) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debug("translate output fields", zap.Any("OutputFields", outputFields))
|
||||
st.query.OutputFields = outputFields
|
||||
|
||||
if st.query.GetDslType() == commonpb.DslType_BoolExprV1 {
|
||||
|
@ -2102,6 +2103,7 @@ func (rt *RetrieveTask) PreExecute(ctx context.Context) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debug("translate output fields", zap.Any("OutputFields", rt.retrieve.OutputFields))
|
||||
if len(rt.retrieve.OutputFields) == 0 {
|
||||
for _, field := range schema.Fields {
|
||||
if field.FieldID >= 100 && field.DataType != schemapb.DataType_FloatVector && field.DataType != schemapb.DataType_BinaryVector {
|
||||
|
@ -2109,9 +2111,9 @@ func (rt *RetrieveTask) PreExecute(ctx context.Context) error {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
addPrimaryKey := false
|
||||
for _, reqField := range rt.retrieve.OutputFields {
|
||||
findField := false
|
||||
addPrimaryKey := false
|
||||
for _, field := range schema.Fields {
|
||||
if reqField == field.Name {
|
||||
if field.IsPrimaryKey {
|
||||
|
@ -2132,6 +2134,7 @@ func (rt *RetrieveTask) PreExecute(ctx context.Context) error {
|
|||
}
|
||||
}
|
||||
}
|
||||
log.Debug("translate output fields to field ids", zap.Any("OutputFieldsID", rt.OutputFieldsId))
|
||||
|
||||
travelTimestamp := rt.retrieve.TravelTimestamp
|
||||
if travelTimestamp == 0 {
|
||||
|
|
Loading…
Reference in New Issue