From 1ea0ba9697540689f830f7cb320c7a6cd3ad0976 Mon Sep 17 00:00:00 2001 From: yhmo Date: Mon, 16 Dec 2024 17:50:13 +0800 Subject: [PATCH] Return recall rate in search result for V2 Signed-off-by: yhmo --- .../main/java/io/milvus/v2/service/vector/VectorService.java | 2 ++ .../java/io/milvus/v2/service/vector/response/SearchResp.java | 1 + sdk-core/src/main/milvus-proto | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk-core/src/main/java/io/milvus/v2/service/vector/VectorService.java b/sdk-core/src/main/java/io/milvus/v2/service/vector/VectorService.java index cf1f96a4a..2024011af 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/vector/VectorService.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/vector/VectorService.java @@ -181,6 +181,7 @@ public SearchResp search(MilvusServiceGrpc.MilvusServiceBlockingStub blockingStu return SearchResp.builder() .searchResults(convertUtils.getEntities(response)) .sessionTs(response.getSessionTs()) + .recalls(response.getResults().getRecallsList()) .build(); } @@ -197,6 +198,7 @@ public SearchResp hybridSearch(MilvusServiceGrpc.MilvusServiceBlockingStub block return SearchResp.builder() .searchResults(convertUtils.getEntities(response)) + .recalls(response.getResults().getRecallsList()) .build(); } diff --git a/sdk-core/src/main/java/io/milvus/v2/service/vector/response/SearchResp.java b/sdk-core/src/main/java/io/milvus/v2/service/vector/response/SearchResp.java index accc2ed68..9047a6562 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/vector/response/SearchResp.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/vector/response/SearchResp.java @@ -30,6 +30,7 @@ public class SearchResp { private List> searchResults; private long sessionTs = 1L; // default eventually ts + private List recalls; @Data @SuperBuilder diff --git a/sdk-core/src/main/milvus-proto b/sdk-core/src/main/milvus-proto index 93892e628..c18fc4249 160000 --- a/sdk-core/src/main/milvus-proto +++ b/sdk-core/src/main/milvus-proto @@ -1 +1 @@ -Subproject commit 93892e628c6908f6dfda6d7eaad3ba1d66037a97 +Subproject commit c18fc42493ca2768a81bf2346340325db1e6cab9