diff --git a/client/data.go b/client/data.go index 725cfb36..cb2cb564 100644 --- a/client/data.go +++ b/client/data.go @@ -140,6 +140,10 @@ func (c *GrpcClient) handleSearchResult(schema *entity.Schema, outputFields []st Scores: results.GetScores()[offset : offset+rc], } + if len(results.GetRecalls()) > 0 { + entry.Recall = results.GetRecalls()[i] + } + entry.IDs, entry.Err = entity.IDColumns(schema, results.GetIds(), offset, offset+rc) if entry.Err != nil { continue diff --git a/client/results.go b/client/results.go index 8aba95ac..b3ce4b9a 100644 --- a/client/results.go +++ b/client/results.go @@ -21,6 +21,7 @@ type SearchResult struct { IDs entity.Column // auto generated id, can be mapped to the columns from `Insert` API Fields ResultSet //[]entity.Column // output field data Scores []float32 // distance to the target vector + Recall float32 // recall of one query vector's search result (estimated by zilliz cloud) Err error // search error if any } diff --git a/go.mod b/go.mod index 9874f9b7..0d0a2813 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/go-faker/faker/v4 v4.1.0 github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 - github.com/milvus-io/milvus-proto/go-api/v2 v2.4.17-0.20241120092224-a1c2ac2fd2c1 + github.com/milvus-io/milvus-proto/go-api/v2 v2.4.18-0.20241125085427-d06253758dac github.com/stretchr/testify v1.8.1 github.com/tidwall/gjson v1.14.4 github.com/x448/float16 v0.8.4 diff --git a/go.sum b/go.sum index cb1bf652..cdbbf52a 100644 --- a/go.sum +++ b/go.sum @@ -158,8 +158,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/milvus-io/milvus-proto/go-api/v2 v2.4.17-0.20241120092224-a1c2ac2fd2c1 h1:WLm5qrm6vPAnuhrKcA0htuaDboG5YOvgzfZgMKEzsGc= -github.com/milvus-io/milvus-proto/go-api/v2 v2.4.17-0.20241120092224-a1c2ac2fd2c1/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= +github.com/milvus-io/milvus-proto/go-api/v2 v2.4.18-0.20241125085427-d06253758dac h1:19Q/+bSE6gBKvDerf1pqMEqJ1oqGt8vXaiUlp2VY+W8= +github.com/milvus-io/milvus-proto/go-api/v2 v2.4.18-0.20241125085427-d06253758dac/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= diff --git a/test/testcases/load_release_test.go b/test/testcases/load_release_test.go index f6f8af6a..0baa1062 100644 --- a/test/testcases/load_release_test.go +++ b/test/testcases/load_release_test.go @@ -144,7 +144,7 @@ func TestLoadEmptyPartitionName(t *testing.T) { // load partition with empty partition names errLoadEmpty := mc.LoadPartitions(ctx, collName, []string{""}, false) - common.CheckErr(t, errLoadEmpty, false, "partition not found[partition=]") + common.CheckErr(t, errLoadEmpty, true) } // test load partitions with empty slice []string{}