MCPcopy Create free account
hub / github.com/alibaba/zvec / LoadIndex

Function LoadIndex

tests/core/algorithm/flat/flat_searcher_test.cpp:67–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67static void LoadIndex(const std::string &path,
68 IndexSearcher::Pointer &searcher) {
69 searcher = IndexFactory::CreateSearcher("FlatSearcher");
70 auto storage = IndexFactory::CreateStorage("MMapFileReadStorage");
71
72 ASSERT_NE(nullptr, searcher);
73 ASSERT_NE(nullptr, storage);
74
75 Params params;
76 ASSERT_EQ(0, searcher->init(params));
77 ASSERT_EQ(0, storage->open(path, false));
78 ASSERT_EQ(0, searcher->load(storage, IndexMetric::Pointer()));
79}
80
81static void Shuffle(std::vector<uint32_t> &keys) {
82 if (keys.size() <= 1) {

Callers 1

TESTFunction · 0.85

Calls 3

initMethod · 0.45
openMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected