| 442 | } |
| 443 | |
| 444 | static void LoadIndex(const std::string &path, |
| 445 | IndexSearcher::Pointer &searcher) { |
| 446 | searcher = IndexFactory::CreateSearcher("FlatSearcher"); |
| 447 | auto storage = IndexFactory::CreateStorage("MMapFileReadStorage"); |
| 448 | ASSERT_NE(nullptr, searcher); |
| 449 | ASSERT_NE(nullptr, storage); |
| 450 | |
| 451 | Params params; |
| 452 | ASSERT_EQ(0, searcher->init(params)); |
| 453 | ASSERT_EQ(0, storage->open(path, false)); |
| 454 | ASSERT_EQ(0, searcher->load(storage, IndexMetric::Pointer())); |
| 455 | } |
| 456 | |
| 457 | namespace { |
| 458 | class ThresholdContext : public IndexContext { |