From c6d9d0df5e2c771b94c5cd958ee4cc7da974d4ce Mon Sep 17 00:00:00 2001 From: Letian Jiang Date: Wed, 17 Aug 2022 20:24:49 +0800 Subject: [PATCH] Fix segcore benchmark (#18675) Signed-off-by: Letian Jiang Signed-off-by: Letian Jiang --- internal/core/unittest/bench/bench_search.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/core/unittest/bench/bench_search.cpp b/internal/core/unittest/bench/bench_search.cpp index 4573388fd2..88f5858573 100644 --- a/internal/core/unittest/bench/bench_search.cpp +++ b/internal/core/unittest/bench/bench_search.cpp @@ -25,6 +25,8 @@ static int dim = 768; const auto schema = []() { auto schema = std::make_shared(); schema->AddDebugField("fakevec", DataType::VECTOR_FLOAT, dim, knowhere::metric::L2); + auto i64_fid = schema->AddDebugField("age", DataType::INT64); + schema->set_primary_field_id(i64_fid); return schema; }(); @@ -40,7 +42,8 @@ const auto plan = [] { "nprobe": 10 }, "query": "$0", - "topk": 5 + "topk": 5, + "round_decimal": -1 } } } @@ -109,6 +112,7 @@ Search_Sealed(benchmark::State& state) { info.index_params["index_type"] = "IVF"; info.index_params["index_mode"] = "CPU"; info.index_params["metric_type"] = knowhere::metric::L2; + segment->DropFieldData(milvus::FieldId(100)); segment->LoadIndex(info); } Timestamp time = 10000000;