From e61a841806e53d1e0471141d874630009a6632b8 Mon Sep 17 00:00:00 2001 From: congqixia Date: Fri, 24 Jan 2025 19:05:06 +0800 Subject: [PATCH] enhance: [GoSDK] Support return recall in search result (#39580) Related to #37899 Signed-off-by: Congqi Xia --- client/milvusclient/read.go | 5 +++++ client/milvusclient/results.go | 1 + 2 files changed, 6 insertions(+) diff --git a/client/milvusclient/read.go b/client/milvusclient/read.go index ab87598c23..6d9a3dc981 100644 --- a/client/milvusclient/read.go +++ b/client/milvusclient/read.go @@ -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 diff --git a/client/milvusclient/results.go b/client/milvusclient/results.go index c5ef9e33f7..0f16fecd59 100644 --- a/client/milvusclient/results.go +++ b/client/milvusclient/results.go @@ -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 }