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
Buqian Zheng 2024-05-11 10:59:32 +08:00 committed by GitHub
parent 7b7b56b4e1
commit 7de9311fe4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 16 deletions

View File

@ -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);