mirror of https://github.com/milvus-io/milvus.git
fix:[2.4] Indexing.Iterator ut: build index with all data at once (#32928)
pr: #32844 issue: #32843 Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>backup/2.4_20240515
parent
7b7b56b4e1
commit
7de9311fe4
|
@ -414,7 +414,6 @@ TEST(Indexing, Iterator) {
|
|||
constexpr int N = 10240;
|
||||
constexpr int TOPK = 100;
|
||||
constexpr int dim = 128;
|
||||
constexpr int chunk_size = 5120;
|
||||
|
||||
auto [raw_data, timestamps, uids] = generate_data<dim>(N);
|
||||
milvus::index::CreateIndexInfo create_index_info;
|
||||
|
@ -437,21 +436,8 @@ TEST(Indexing, Iterator) {
|
|||
{knowhere::indexparam::NPROBE, 4},
|
||||
};
|
||||
|
||||
std::vector<knowhere::DataSetPtr> datasets;
|
||||
auto raw = raw_data.data();
|
||||
for (int beg = 0; beg < N; beg += chunk_size) {
|
||||
auto end = beg + chunk_size;
|
||||
if (end > N) {
|
||||
end = N;
|
||||
}
|
||||
std::vector<float> ft(raw + dim * beg, raw + dim * end);
|
||||
auto ds = knowhere::GenDataSet(end - beg, dim, ft.data());
|
||||
datasets.push_back(ds);
|
||||
}
|
||||
|
||||
for (auto& ds : datasets) {
|
||||
index->BuildWithDataset(ds, build_conf);
|
||||
}
|
||||
index->BuildWithDataset(knowhere::GenDataSet(N, dim, raw_data.data()),
|
||||
build_conf);
|
||||
|
||||
auto bitmap = BitsetType(N, false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue