mirror of https://github.com/milvus-io/milvus.git
Fix range search error (#22352)
Signed-off-by: lixinguo <xinguo.li@zilliz.com> Co-authored-by: lixinguo <xinguo.li@zilliz.com>pull/22244/head
parent
a9a263d5a8
commit
820d0bc060
|
@ -46,7 +46,10 @@ SortRangeSearchResult(DatasetPtr data_set, int64_t topk, int64_t nq, std::string
|
|||
|
||||
// use p_id and p_dist to GenResultDataset after sorted
|
||||
auto p_id = new int64_t[topk * nq];
|
||||
memset(p_id, -1, sizeof(int64_t) * topk * nq);
|
||||
auto p_dist = new float[topk * nq];
|
||||
std::fill_n(p_dist, topk * nq, std::numeric_limits<float>::max());
|
||||
|
||||
// cnt means the subscript of p_id and p_dist
|
||||
int cnt = 0;
|
||||
|
||||
|
|
|
@ -37,7 +37,9 @@ RangeSearchSortResultBF(milvus::DatasetPtr data_set, int64_t topk, size_t nq, st
|
|||
auto id = milvus::GetDatasetIDs(data_set);
|
||||
auto dist = milvus::GetDatasetDistance(data_set);
|
||||
auto p_id = new int64_t[topk * nq];
|
||||
memset(p_id, -1, sizeof(int64_t) * topk * nq);
|
||||
auto p_dist = new float[topk * nq];
|
||||
std::fill_n(p_dist, topk * nq, std::numeric_limits<float>::max());
|
||||
// cnt means the subscript of p_id and p_dist
|
||||
int cnt = 0;
|
||||
for (int i = 0; i < nq; i++) {
|
||||
|
|
Loading…
Reference in New Issue