diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-24 11:09:34 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-31 15:58:39 +0000 |
commit | 7d7b46f012b4f9bbd416f17a945204acc28c6ae5 (patch) | |
tree | 96a4cc5f82fea12b073e70522219c5c6b36ffbec /searchcore/src/tests/proton/matching | |
parent | 6d7909e022817be11b5f088cbd1e537d9b71919d (diff) |
Add ExecutionInfo to propagate more information than just strictness to fetchPostings.
The estimated hitrate that each iterator will will enable smarter query evaluation.
Especially will it be possible to figure out if static up front cost can be avoided.
Diffstat (limited to 'searchcore/src/tests/proton/matching')
3 files changed, 12 insertions, 10 deletions
diff --git a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp index 2d0482b0d92..201824cd764 100644 --- a/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp +++ b/searchcore/src/tests/proton/matching/match_phase_limiter/match_phase_limiter_test.cpp @@ -4,6 +4,7 @@ #include <vespa/searchlib/queryeval/termasstring.h> #include <vespa/searchlib/queryeval/andsearchstrict.h> #include <vespa/searchlib/queryeval/fake_requestcontext.h> +#include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <vespa/searchlib/engine/trace.h> #include <vespa/vespalib/data/slime/slime.h> @@ -54,7 +55,7 @@ struct MockBlueprint : SimpleLeafBlueprint { FieldSpec spec; vespalib::string term; bool postings_fetched = false; - bool postings_strict = false; + search::queryeval::ExecuteInfo postings_strict = search::queryeval::ExecuteInfo::FALSE; MockBlueprint(const FieldSpec &spec_in, const vespalib::string &term_in) : SimpleLeafBlueprint(FieldSpecBaseList().add(spec_in)), spec(spec_in), term(term_in) { @@ -64,13 +65,13 @@ struct MockBlueprint : SimpleLeafBlueprint { bool strict) const override { if (postings_fetched) { - EXPECT_EQUAL(postings_strict, strict); + EXPECT_EQUAL(postings_strict.isStrict(), strict); } return SearchIterator::UP(new MockSearch(spec, term, strict, tfmda, postings_fetched)); } - virtual void fetchPostings(bool strict) override { - postings_strict = strict; + virtual void fetchPostings(const search::queryeval::ExecuteInfo &execInfo) override { + postings_strict = execInfo; postings_fetched = true; } }; diff --git a/searchcore/src/tests/proton/matching/query_test.cpp b/searchcore/src/tests/proton/matching/query_test.cpp index cc6d964219d..a1215649943 100644 --- a/searchcore/src/tests/proton/matching/query_test.cpp +++ b/searchcore/src/tests/proton/matching/query_test.cpp @@ -69,6 +69,7 @@ using search::queryeval::AndBlueprint; using search::queryeval::IntermediateBlueprint; using search::queryeval::AndNotBlueprint; using search::queryeval::SourceBlenderBlueprint; +using search::queryeval::ExecuteInfo; using std::string; using std::vector; @@ -455,7 +456,7 @@ SearchIterator::UP Test::getIterator(Node &node, ISearchContext &context) { _blueprint = BlueprintBuilder::build(_requestContext, node, context); - _blueprint->fetchPostings(true); + _blueprint->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP search(_blueprint->createSearch(*_match_data, true)); search->initFullRange(); return search; @@ -822,10 +823,10 @@ Test::requireThatFakeFieldSearchDumpsDiffer() Blueprint::UP l3(a.createBlueprint(requestContext, fields2, n3)); // field Blueprint::UP l4(b.createBlueprint(requestContext, fields1, n1)); // tag - l1->fetchPostings(true); - l2->fetchPostings(true); - l3->fetchPostings(true); - l4->fetchPostings(true); + l1->fetchPostings(ExecuteInfo::TRUE); + l2->fetchPostings(ExecuteInfo::TRUE); + l3->fetchPostings(ExecuteInfo::TRUE); + l4->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP s1(l1->createSearch(*match_data, true)); SearchIterator::UP s2(l2->createSearch(*match_data, true)); diff --git a/searchcore/src/tests/proton/matching/querynodes_test.cpp b/searchcore/src/tests/proton/matching/querynodes_test.cpp index 297f75054b2..5d01753dfb6 100644 --- a/searchcore/src/tests/proton/matching/querynodes_test.cpp +++ b/searchcore/src/tests/proton/matching/querynodes_test.cpp @@ -201,7 +201,7 @@ public: MatchData::UP match_data = mdl.createMatchData(); Blueprint::UP blueprint = BlueprintBuilder::build(requestContext, node, context); - blueprint->fetchPostings(true); + blueprint->fetchPostings(search::queryeval::ExecuteInfo::TRUE); return blueprint->createSearch(*match_data, true)->asString(); } |