Skip to content

Commit

Permalink
enhance: [GoSDK] Support return recall in search result (#39580)
Browse files Browse the repository at this point in the history
Related to #37899

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Jan 24, 2025
1 parent c4ae9f4 commit e61a841
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/milvusclient/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ func (c *Client) handleSearchResult(schema *entity.Schema, outputFields []string
sch: schema,
}

// set recall if returned
if i < len(results.Recalls) {
entry.Recall = results.Recalls[i]
}

entry.IDs, entry.Err = column.IDColumns(schema, results.GetIds(), offset, offset+rc)
if entry.Err != nil {
offset += rc
Expand Down
1 change: 1 addition & 0 deletions client/milvusclient/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type ResultSet struct {
IDs column.Column // auto generated id, can be mapped to the columns from `Insert` API
Fields DataSet // output field data
Scores []float32 // distance to the target vector
Recall float32 // recall of the query vector's search result (estimated by zilliz cloud)
Err error // search error if any
}

Expand Down

0 comments on commit e61a841

Please sign in to comment.