aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-11-03 20:25:37 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-11-03 20:29:50 +0000
commit1d83798c32557577f692b8186f59f8692e06c7fc (patch)
tree3ba27ec3212201516afe43745950c978c115999a /searchcore/src/tests
parent10cfb0c78fd1bf8ce12818849378c6205d6980d9 (diff)
- Add maxHits param that can be used to compute a realistic(low) hit rate when fetching summaries (summary features).
Diffstat (limited to 'searchcore/src/tests')
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp10
-rw-r--r--searchcore/src/tests/proton/matching/query_test.cpp10
2 files changed, 11 insertions, 9 deletions
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index 9ac930cdbab..5f4f26c6c6b 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.cpp
@@ -3,7 +3,6 @@
#include <vespa/searchcore/proton/bucketdb/bucket_db_owner.h>
#include <vespa/searchcore/proton/documentmetastore/documentmetastore.h>
#include <vespa/searchcore/proton/matching/fakesearchcontext.h>
-#include <vespa/searchcore/proton/matching/match_context.h>
#include <vespa/searchcore/proton/matching/match_params.h>
#include <vespa/searchcore/proton/matching/match_tools.h>
#include <vespa/searchcore/proton/matching/matcher.h>
@@ -28,7 +27,6 @@
#include <vespa/searchlib/query/tree/stackdumpcreator.h>
#include <vespa/searchlib/queryeval/isourceselector.h>
#include <vespa/searchlib/test/mock_attribute_context.h>
-#include <vespa/searchcommon/attribute/iattributecontext.h>
#include <vespa/document/base/globalid.h>
#include <vespa/eval/eval/simple_value.h>
#include <vespa/eval/eval/tensor_spec.h>
@@ -377,7 +375,8 @@ struct MyWorld {
void verify_diversity_filter(const SearchRequest & req, bool expectDiverse) {
Matcher::SP matcher = createMatcher();
search::fef::Properties overrides;
- auto mtf = matcher->create_match_tools_factory(req, searchContext, attributeContext, metaStore, overrides, ttb(), nullptr, true);
+ auto mtf = matcher->create_match_tools_factory(req, searchContext, attributeContext, metaStore, overrides,
+ ttb(), nullptr, searchContext.getDocIdLimit(), true);
auto diversity = mtf->createDiversifier(HeapSize::lookup(config));
EXPECT_EQUAL(expectDiverse, static_cast<bool>(diversity));
}
@@ -386,7 +385,8 @@ struct MyWorld {
Matcher::SP matcher = createMatcher();
SearchRequest::SP request = createSimpleRequest("f1", "spread");
search::fef::Properties overrides;
- auto mtf = matcher->create_match_tools_factory(*request, searchContext, attributeContext, metaStore, overrides, ttb(), nullptr, true);
+ auto mtf = matcher->create_match_tools_factory(*request, searchContext, attributeContext, metaStore, overrides,
+ ttb(), nullptr, searchContext.getDocIdLimit(), true);
MatchTools::UP match_tools = mtf->createMatchTools();
match_tools->setup_first_phase(nullptr);
return match_tools->match_data().get_termwise_limit();
@@ -1156,7 +1156,7 @@ struct AttributeBlueprintParamsFixture {
}
void set_query_properties(vespalib::stringref lower_limit, vespalib::stringref upper_limit,
vespalib::stringref target_hits_max_adjustment_factor,
- const vespalib::string fuzzy_matching_algorithm) {
+ const vespalib::string & fuzzy_matching_algorithm) {
rank_properties.add(GlobalFilterLowerLimit::NAME, lower_limit);
rank_properties.add(GlobalFilterUpperLimit::NAME, upper_limit);
rank_properties.add(TargetHitsMaxAdjustmentFactor::NAME, target_hits_max_adjustment_factor);
diff --git a/searchcore/src/tests/proton/matching/query_test.cpp b/searchcore/src/tests/proton/matching/query_test.cpp
index 34c50084c35..928e13a9fae 100644
--- a/searchcore/src/tests/proton/matching/query_test.cpp
+++ b/searchcore/src/tests/proton/matching/query_test.cpp
@@ -711,7 +711,7 @@ void Test::requireThatQueryGluesEverythingTogether() {
EXPECT_EQUAL(1u, md->getNumTermFields());
query.optimize();
- query.fetchPostings(requestContext.getDoom());
+ query.fetchPostings(search::queryeval::ExecuteInfo::create(true, &requestContext.getDoom()));
SearchIterator::UP search = query.createSearch(*md);
ASSERT_TRUE(search.get());
}
@@ -744,7 +744,7 @@ void checkQueryAddsLocation(const string &loc_in, const string &loc_out) {
MatchData::UP md = mdl.createMatchData();
EXPECT_EQUAL(2u, md->getNumTermFields());
- query.fetchPostings(requestContext.getDoom());
+ query.fetchPostings(search::queryeval::ExecuteInfo::create(true, &requestContext.getDoom()));
SearchIterator::UP search = query.createSearch(*md);
ASSERT_TRUE(search.get());
if (!EXPECT_NOT_EQUAL(string::npos, search->asString().find(loc_out))) {
@@ -966,7 +966,7 @@ Test::requireThatWhiteListBlueprintCanBeUsed()
MatchData::UP md = mdl.createMatchData();
query.optimize();
- query.fetchPostings(requestContext.getDoom());
+ query.fetchPostings(search::queryeval::ExecuteInfo::create(true, &requestContext.getDoom()));
SearchIterator::UP search = query.createSearch(*md);
SimpleResult exp = SimpleResult().addHit(1).addHit(5).addHit(7).addHit(11);
SimpleResult act;
@@ -1129,13 +1129,15 @@ public:
{
set_want_global_filter(want_global_filter);
}
- ~GlobalFilterBlueprint() {}
+ ~GlobalFilterBlueprint();
void set_global_filter(const GlobalFilter& filter_, double estimated_hit_ratio_) override {
filter = filter_.shared_from_this();
estimated_hit_ratio = estimated_hit_ratio_;
}
};
+GlobalFilterBlueprint::~GlobalFilterBlueprint() = default;
+
void
Test::global_filter_is_calculated_and_handled()
{