fix: [GoSDK] Compose result set for result zero hit case (#34129)

See also #33952

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/34169/head
congqixia 2024-06-25 19:06:02 +08:00 committed by GitHub
parent f9a0f7bb25
commit b1a34732b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 13 deletions

View File

@ -78,24 +78,22 @@ func (c *Client) handleSearchResult(schema *entity.Schema, outputFields []string
ResultCount: rc,
Scores: results.GetScores()[offset : offset+rc],
}
// parse result set if current nq is not empty
if rc > 0 {
entry.IDs, entry.Err = column.IDColumns(schema, results.GetIds(), offset, offset+rc)
entry.IDs, entry.Err = column.IDColumns(schema, results.GetIds(), offset, offset+rc)
if entry.Err != nil {
offset += rc
continue
}
// parse group-by values
if gb != nil {
entry.GroupByValue, entry.Err = column.FieldDataColumn(gb, offset, offset+rc)
if entry.Err != nil {
offset += rc
continue
}
// parse group-by values
if gb != nil {
entry.GroupByValue, entry.Err = column.FieldDataColumn(gb, offset, offset+rc)
if entry.Err != nil {
offset += rc
continue
}
}
entry.Fields, entry.Err = c.parseSearchResult(schema, outputFields, fieldDataList, i, offset, offset+rc)
sr = append(sr, entry)
}
entry.Fields, entry.Err = c.parseSearchResult(schema, outputFields, fieldDataList, i, offset, offset+rc)
sr = append(sr, entry)
offset += rc
}