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

Function BuildIndex

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

Source from the content-addressed store, hash-verified

28static const std::string INDEX_PATH = "brute_force_searcher_test/out.indexes";
29
30static void BuildIndex(const IndexMeta &meta, IndexHolder::Pointer holder,
31 const std::string &path) {
32 auto builder = IndexFactory::CreateBuilder("FlatBuilder");
33 auto dumper = IndexFactory::CreateDumper("FileDumper");
34
35 ASSERT_NE(nullptr, builder);
36 ASSERT_NE(nullptr, dumper);
37
38 Params params;
39 ASSERT_EQ(0, builder->init(meta, params));
40 ASSERT_EQ(0, dumper->create(path));
41 ASSERT_EQ(0, IndexBuilder::TrainBuildAndDump(builder, holder, dumper));
42 ASSERT_EQ(0, dumper->close());
43
44 auto stats = builder->stats();
45 ASSERT_EQ(0UL, stats.trained_count());
46 ASSERT_EQ(0UL, stats.discarded_count());
47}
48
49static void BuildIndex(const IndexMeta &meta, const Params &params,
50 IndexHolder::Pointer holder, const std::string &path) {

Callers 1

TESTFunction · 0.85

Calls 6

initMethod · 0.45
createMethod · 0.45
closeMethod · 0.45
statsMethod · 0.45
trained_countMethod · 0.45
discarded_countMethod · 0.45

Tested by

no test coverage detected