| 427 | } |
| 428 | |
| 429 | static void LoadQuantizedIndex( |
| 430 | const std::string &path, |
| 431 | const std::shared_ptr<zvec::turbo::Quantizer> &quantizer, |
| 432 | IndexSearcher::Pointer &searcher) { |
| 433 | searcher = IndexFactory::CreateSearcher("FlatSearcher"); |
| 434 | auto storage = IndexFactory::CreateStorage("MMapFileReadStorage"); |
| 435 | ASSERT_NE(nullptr, searcher); |
| 436 | ASSERT_NE(nullptr, storage); |
| 437 | |
| 438 | Params params; |
| 439 | ASSERT_EQ(0, searcher->init(params, quantizer)); |
| 440 | ASSERT_EQ(0, storage->open(path, false)); |
| 441 | ASSERT_EQ(0, searcher->load(storage, IndexMetric::Pointer())); |
| 442 | } |
| 443 | |
| 444 | static void LoadIndex(const std::string &path, |
| 445 | IndexSearcher::Pointer &searcher) { |