未验证 提交 e5343371 编写于 作者: Y yukun 提交者: GitHub

Return wrong entities when real result number is less than topk (#4003)

* Server crashed when search using java-sdk
Signed-off-by: Nfishpenguin <kun.yu@zilliz.com>

* Return wrong entities when real result number is less than topk
Signed-off-by: Nfishpenguin <kun.yu@zilliz.com>
上级 cdd40689
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册