mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
feat(db): add some print
Former-commit-id: 200b365c40532a13d777457bd53e6788fd613559
This commit is contained in:
parent
d003ed2af4
commit
b377266934
@ -255,13 +255,18 @@ Status DBImpl::build_index(const meta::GroupFileSchema& file) {
|
||||
}
|
||||
|
||||
auto opd = std::make_shared<Operand>();
|
||||
opd->d = file.dimension;
|
||||
opd->index_type = "IDMap,Flat";
|
||||
IndexBuilderPtr pBuilder = GetIndexBuilder(opd);
|
||||
|
||||
auto from_index = dynamic_cast<faiss::IndexIDMap*>(faiss::read_index(file.location.c_str()));
|
||||
std::cout << "Preparing build_index for file_id=" << file.file_id
|
||||
<< " with new index_file_id=" << group_file.file_id << std::endl;
|
||||
auto index = pBuilder->build_all(from_index->ntotal,
|
||||
dynamic_cast<faiss::IndexFlat*>(from_index->index)->xb.data(),
|
||||
from_index->id_map.data());
|
||||
std::cout << "Ending build_index for file_id=" << file.file_id
|
||||
<< " with new index_file_id=" << group_file.file_id << std::endl;
|
||||
/* std::cout << "raw size=" << from_index->ntotal << " index size=" << index->ntotal << std::endl; */
|
||||
write_index(index, group_file.location.c_str());
|
||||
group_file.file_type = meta::GroupFileSchema::INDEX;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user