mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Return wrong entities when real result number is less than topk (#4003)
* Server crashed when search using java-sdk Signed-off-by: fishpenguin <kun.yu@zilliz.com> * Return wrong entities when real result number is less than topk Signed-off-by: fishpenguin <kun.yu@zilliz.com>
This commit is contained in:
parent
cdd40689f5
commit
e5343371f1
@ -1837,7 +1837,14 @@ GrpcRequestHandler::Search(::grpc::ServerContext* context, const ::milvus::grpc:
|
||||
// step 6: construct and return result
|
||||
response->set_row_num(result->row_num_);
|
||||
int64_t id_size = result->result_ids_.size();
|
||||
grpc_entity->mutable_valid_row()->Resize(id_size, true);
|
||||
for (int64_t i = 0; i < result->result_ids_.size(); i++) {
|
||||
if (result->result_ids_[i] == -1) {
|
||||
id_size--;
|
||||
grpc_entity->add_valid_row(false);
|
||||
} else {
|
||||
grpc_entity->add_valid_row(true);
|
||||
}
|
||||
}
|
||||
|
||||
CopyDataChunkToEntity(result->data_chunk_, field_mappings, id_size, grpc_entity);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user