diff options
75 files changed, 251 insertions, 187 deletions
diff --git a/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h b/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h index 9a24ab82c9f..795129bf3b8 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h +++ b/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h @@ -6,7 +6,10 @@ #include <vespa/vespalib/stllike/string.h> namespace search::fef { class TermFieldMatchData; } -namespace search::queryeval { class SearchIterator; } +namespace search::queryeval { + class SearchIterator; + class ExecuteInfo; +} namespace search { class QueryTermUCS4; } namespace search::attribute { @@ -43,7 +46,7 @@ public: * Create temporary posting lists. * Should be called before createIterator() is called. */ - virtual void fetchPostings(bool strict) = 0; + virtual void fetchPostings(const queryeval::ExecuteInfo &execInfo) = 0; virtual bool valid() const = 0; virtual Int64Range getAsIntegerTerm() const = 0; diff --git a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp index 4dbc6be57ff..f8069dcf494 100644 --- a/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp +++ b/searchcore/src/tests/proton/documentmetastore/documentmetastore_test.cpp @@ -193,7 +193,7 @@ assertWhiteList(const SimpleResult &exp, Blueprint::UP whiteListBlueprint, bool { MatchDataLayout mdl; MatchData::UP md = mdl.createMatchData(); - whiteListBlueprint->fetchPostings(strict); + whiteListBlueprint->fetchPostings(search::queryeval::ExecuteInfo::create(strict)); whiteListBlueprint->setDocIdLimit(docIdLimit); SearchIterator::UP sb = whiteListBlueprint->createSearch(*md, strict); diff --git a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp index 4580865b3a4..ca45108b698 100644 --- a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp +++ b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp @@ -125,7 +125,7 @@ void Test::testSearch(Searchable &source, SimpleStringTerm node(term, field_name, 0, search::query::Weight(0)); Blueprint::UP result = source.createBlueprint(requestContext, FieldSpecList().add(FieldSpec(field_name, 0, handle)), node); - result->fetchPostings(true); + result->fetchPostings(search::queryeval::ExecuteInfo::TRUE); SearchIterator::UP search_iterator = result->createSearch(*match_data, true); search_iterator->initFullRange(); diff --git a/searchcore/src/tests/proton/index/fusionrunner_test.cpp b/searchcore/src/tests/proton/index/fusionrunner_test.cpp index 49b452aec2e..975061f9d88 100644 --- a/searchcore/src/tests/proton/index/fusionrunner_test.cpp +++ b/searchcore/src/tests/proton/index/fusionrunner_test.cpp @@ -243,7 +243,7 @@ void Test::checkResults(uint32_t fusion_id, const uint32_t *ids, size_t size) { search::queryeval::Searchable &searchable = disk_index; SimpleStringTerm node(term, field_name, fieldId, search::query::Weight(0)); Blueprint::UP blueprint = searchable.createBlueprint(requestContext, fields, node); - blueprint->fetchPostings(true); + blueprint->fetchPostings(search::queryeval::ExecuteInfo::TRUE); SearchIterator::UP search = blueprint->createSearch(*match_data, true); search->initFullRange(); for (size_t i = 0; i < size; ++i) { 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(); } diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp index 94217371af3..0c03727e017 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.cpp @@ -2,6 +2,7 @@ #include "lid_allocator.h" #include <vespa/searchlib/common/bitvectoriterator.h> +#include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <mutex> #include <vespa/log/log.h> @@ -197,7 +198,7 @@ private: mutable std::mutex _lock; mutable std::vector<search::fef::TermFieldMatchData *> _matchDataVector; - virtual SearchIterator::UP + SearchIterator::UP createLeafSearch(const TermFieldMatchDataArray &tfmda, bool strict) const override { diff --git a/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp b/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp index d165a18ae37..a0841295746 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp @@ -77,7 +77,7 @@ AttributeLimiter::create_search(size_t want_hits, size_t max_group_size, bool st FieldSpecList field; // single field API is protected field.add(FieldSpec(_attribute_name, my_field_id, my_handle)); _blueprint = _searchable_attributes.createBlueprint(_requestContext, field, node); - _blueprint->fetchPostings(strictSearch); + _blueprint->fetchPostings(ExecuteInfo::create(strictSearch)); _estimatedHits = _blueprint->getState().estimate().estHits; _blueprint->freeze(); } diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp index fb9882bf1b1..04fdf57769a 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp @@ -195,7 +195,7 @@ Query::optimize() void Query::fetchPostings() { - _blueprint->fetchPostings(true); + _blueprint->fetchPostings(search::queryeval::ExecuteInfo(true, 1.0)); } void diff --git a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp index 39f6a489908..dabdf16e69e 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp @@ -224,7 +224,7 @@ WarmupIndexCollection::WarmupTask::run() { if (_warmup._warmupEndTime != vespalib::steady_time()) { LOG(debug, "Warming up %s", _bluePrint->asString().c_str()); - _bluePrint->fetchPostings(true); + _bluePrint->fetchPostings(search::queryeval::ExecuteInfo::TRUE); SearchIterator::UP it(_bluePrint->createSearch(*_matchData, true)); it->initFullRange(); for (uint32_t docId = it->seekFirst(1); !it->isAtEnd(); docId = it->seekNext(docId+1)) { diff --git a/searchlib/src/apps/tests/memoryindexstress_test.cpp b/searchlib/src/apps/tests/memoryindexstress_test.cpp index 1571cef630b..a7689cd6b9f 100644 --- a/searchlib/src/apps/tests/memoryindexstress_test.cpp +++ b/searchlib/src/apps/tests/memoryindexstress_test.cpp @@ -323,9 +323,9 @@ Fixture::readWork(uint32_t cnt) } else { ++nonEmptyCount; } - result->fetchPostings(true); + result->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP search = result->createSearch(*match_data, true); - if (!EXPECT_TRUE(search.get() != 0)) { + if (!EXPECT_TRUE(search)) { LOG(error, "Did not get search iterator"); break; } @@ -418,7 +418,7 @@ verifyResult(const FakeResult &expect, EXPECT_EQUAL(expect.inspect().size(), result->getState().estimate().estHits); EXPECT_EQUAL(expect.inspect().empty(), result->getState().estimate().empty); - result->fetchPostings(true); + result->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP search = result->createSearch(*match_data, true); if (!EXPECT_TRUE(search.get() != 0)) { return false; diff --git a/searchlib/src/tests/attribute/benchmark/attributesearcher.h b/searchlib/src/tests/attribute/benchmark/attributesearcher.h index 8ff6ba46e86..bcb70abc654 100644 --- a/searchlib/src/tests/attribute/benchmark/attributesearcher.h +++ b/searchlib/src/tests/attribute/benchmark/attributesearcher.h @@ -6,6 +6,7 @@ #include <vespa/searchlib/attribute/attribute.h> #include <vespa/searchlib/attribute/attributeguard.h> #include <vespa/searchlib/queryeval/hitcollector.h> +#include <vespa/searchlib/queryeval/executeinfo.h> #include <vespa/vespalib/stllike/asciistream.h> #include <vespa/vespalib/util/compress.h> #include <vespa/searchlib/parsequery/parse.h> @@ -133,7 +134,7 @@ AttributeFindSearcher<T>::doRun() _attrPtr->getSearch(vespalib::stringref(&_query[0], _query.size()), attribute::SearchContextParams()); - searchContext->fetchPostings(true); + searchContext->fetchPostings(queryeval::ExecuteInfo::TRUE); std::unique_ptr<queryeval::SearchIterator> iterator = searchContext->createIterator(nullptr, true); std::unique_ptr<ResultSet> results = performSearch(*iterator, _attrPtr->getNumDocs()); @@ -211,7 +212,7 @@ AttributeRangeSearcher::doRun() _attrPtr->getSearch(vespalib::stringref(&_query[0], _query.size()), attribute::SearchContextParams()); - searchContext->fetchPostings(true); + searchContext->fetchPostings(queryeval::ExecuteInfo::TRUE); std::unique_ptr<queryeval::SearchIterator> iterator = searchContext->createIterator(nullptr, true); std::unique_ptr<ResultSet> results = performSearch(*iterator, _attrPtr->getNumDocs()); @@ -250,7 +251,7 @@ AttributePrefixSearcher::doRun() _attrPtr->getSearch(vespalib::stringref(&_query[0], _query.size()), attribute::SearchContextParams()); - searchContext->fetchPostings(true); + searchContext->fetchPostings(queryeval::ExecuteInfo::TRUE); std::unique_ptr<queryeval::SearchIterator> iterator = searchContext->createIterator(nullptr, true); std::unique_ptr<ResultSet> results = performSearch(*iterator, _attrPtr->getNumDocs()); diff --git a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp index a8abf1ff4fe..24919fb2341 100644 --- a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp +++ b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp @@ -17,6 +17,8 @@ #include <vespa/searchlib/parsequery/parse.h> #include <vespa/log/log.h> +#include <vespa/searchlib/queryeval/executeinfo.h> + LOG_SETUP("bitvector_test"); using search::AttributeFactory; @@ -454,7 +456,7 @@ BitVectorTest::checkSearch(AttributePtr v, bool checkStride) { TermFieldMatchData md; - sc->fetchPostings(true); + sc->fetchPostings(search::queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = sc->createIterator(&md, true); checkSearch(v, std::move(sb), md, expFirstDocId, expLastDocId, expDocFreq, weights, diff --git a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp index 09cd186811d..bf829f6607a 100644 --- a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp +++ b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp @@ -9,11 +9,11 @@ #include <vespa/searchlib/attribute/attributememoryfilebufferwriter.h> #include <vespa/searchlib/attribute/attributememorysavetarget.h> #include <vespa/searchlib/attribute/attributesaver.h> -#include <vespa/searchlib/attribute/attrvector.h> #include <vespa/searchlib/attribute/multinumericattribute.h> #include <vespa/searchlib/attribute/multistringattribute.h> #include <vespa/searchlib/attribute/singlenumericattribute.h> #include <vespa/searchlib/attribute/singlestringattribute.h> +#include <vespa/searchlib/queryeval/executeinfo.h> #include <vespa/searchlib/fef/termfieldmatchdata.h> #include <vespa/searchlib/index/dummyfileheadercontext.h> #include <vespa/searchlib/parsequery/parse.h> @@ -29,6 +29,7 @@ #include <cmath> using search::AttributeFactory; +using search::AttributeVector; using search::AttributeMemoryFileBufferWriter; using search::BufferWriter; using search::FloatingPointAttribute; @@ -630,7 +631,7 @@ EnumeratedSaveTest::testReload(AttributePtr v0, TermFieldMatchData md; SearchContextPtr sc = getSearch<VectorType>(as<VectorType>(v)); - sc->fetchPostings(true); + sc->fetchPostings(search::queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = sc->createIterator(&md, true); sb->initFullRange(); sb->seek(1u); diff --git a/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp b/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp index e8dbaefc2ba..1db013aaef3 100644 --- a/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp +++ b/searchlib/src/tests/attribute/imported_search_context/imported_search_context_test.cpp @@ -8,6 +8,7 @@ #include <vespa/searchlib/queryeval/simpleresult.h> #include <vespa/searchlib/test/imported_attribute_fixture.h> #include <vespa/vespalib/test/insertion_operators.h> +#include <vespa/searchlib/queryeval/executeinfo.h> namespace search::attribute { @@ -210,7 +211,7 @@ TEST_F("Non-strict iterator unpacks target match data for weighted set hit", Wse TEST_F("Strict iterator is marked as strict", Fixture) { auto ctx = f.create_context(word_term("5678")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match; auto iter = f.create_strict_iterator(*ctx, match); @@ -232,7 +233,7 @@ struct SingleValueFixture : Fixture { TEST_F("Strict iterator seeks to first available hit LID", SingleValueFixture) { auto ctx = f.create_context(word_term("5678")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match; auto iter = f.create_strict_iterator(*ctx, match); @@ -258,7 +259,7 @@ TEST_F("Strict iterator seeks to first available hit LID", SingleValueFixture) { TEST_F("Strict iterator unpacks target match data for single value hit", SingleValueFixture) { auto ctx = f.create_context(word_term("5678")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match; auto iter = f.create_strict_iterator(*ctx, match); @@ -270,7 +271,7 @@ TEST_F("Strict iterator unpacks target match data for single value hit", SingleV TEST_F("Strict iterator unpacks target match data for array hit", ArrayValueFixture) { auto ctx = f.create_context(word_term("1234")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match; auto iter = f.create_strict_iterator(*ctx, match); @@ -282,7 +283,7 @@ TEST_F("Strict iterator unpacks target match data for array hit", ArrayValueFixt TEST_F("Strict iterator unpacks target match data for weighted set hit", WsetValueFixture) { auto ctx = f.create_context(word_term("foo")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match; auto iter = f.create_strict_iterator(*ctx, match); @@ -293,7 +294,7 @@ TEST_F("Strict iterator unpacks target match data for weighted set hit", WsetVal TEST_F("Strict iterator handles seek outside of LID space", ArrayValueFixture) { auto ctx = f.create_context(word_term("1234")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match; auto iter = f.create_strict_iterator(*ctx, match); @@ -325,7 +326,7 @@ TEST_F("matches(weight) performs GID mapping and forwards to target attribute", TEST_F("Multiple iterators can be created from the same context", SingleValueFixture) { auto ctx = f.create_context(word_term("5678")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match1; auto iter1 = f.create_strict_iterator(*ctx, match1); @@ -380,7 +381,7 @@ TEST_F("Bit vector from search cache is used if found", SearchCacheFixture) f.imported_attr->getSearchCache()->insert("5678", makeSearchCacheEntry({2, 6}, f.get_imported_attr()->getNumDocs())); auto ctx = f.create_context(word_term("5678")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match; auto iter = f.create_strict_iterator(*ctx, match); TEST_DO(f.assertSearch({2, 6}, *iter)); // Note: would be {3, 5} if cache was not used @@ -399,7 +400,7 @@ TEST_F("Entry is inserted into search cache if bit vector posting list is used", { EXPECT_EQUAL(0u, f.imported_attr->getSearchCache()->size()); auto ctx = f.create_context(word_term("5678")); - ctx->fetchPostings(true); + ctx->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData match; auto iter = f.create_strict_iterator(*ctx, match); TEST_DO(f.assertSearch({3, 5}, *iter)); diff --git a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp index 9b4c72e1027..0bb10bcdbe6 100644 --- a/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp +++ b/searchlib/src/tests/attribute/postinglistattribute/postinglistattribute_test.cpp @@ -10,6 +10,7 @@ #include <vespa/searchlib/attribute/multinumericpostattribute.h> #include <vespa/searchlib/attribute/singlestringpostattribute.h> #include <vespa/searchlib/attribute/multistringpostattribute.h> +#include <vespa/searchlib/queryeval/executeinfo.h> #include <vespa/searchlib/parsequery/parse.h> #include <vespa/searchlib/attribute/enumstore.hpp> #include <vespa/searchlib/attribute/attributevector.hpp> @@ -375,7 +376,7 @@ PostingListAttributeTest::assertSearch(const std::string &exp, StringAttribute & { TermFieldMatchData md; SearchContextPtr sc = getSearch<StringAttribute>(sa); - sc->fetchPostings(true); + sc->fetchPostings(queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = sc->createIterator(&md, true); if (!EXPECT_TRUE(assertIterator(exp, *sb))) return false; @@ -388,7 +389,7 @@ PostingListAttributeTest::assertSearch(const std::string &exp, StringAttribute & { TermFieldMatchData md; SearchContextPtr sc = getSearch<StringAttribute, std::string>(sa, key, false); - sc->fetchPostings(true); + sc->fetchPostings(queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = sc->createIterator(&md, true); if (!EXPECT_TRUE(assertIterator(exp, *sb, &md))) return false; @@ -400,7 +401,7 @@ PostingListAttributeTest::assertSearch(const std::string &exp, IntegerAttribute { TermFieldMatchData md; SearchContextPtr sc = getSearch<IntegerAttribute, int32_t>(ia, key, false); - sc->fetchPostings(true); + sc->fetchPostings(queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = sc->createIterator(&md, true); if (!EXPECT_TRUE(assertIterator(exp, *sb, &md))) return false; @@ -478,7 +479,7 @@ PostingListAttributeTest::checkSearch(bool useBitVector, const AttributeVector & { SearchContextPtr sc = getSearch(vec, term, false, attribute::SearchContextParams().useBitVector(useBitVector)); EXPECT_FALSE( ! sc ); - sc->fetchPostings(true); + sc->fetchPostings(queryeval::ExecuteInfo::TRUE); size_t approx = sc->approximateHits(); EXPECT_EQUAL(numHits, approx); if (docBegin == 0) { @@ -883,15 +884,14 @@ PostingListAttributeTest::testMinMax(AttributePtr &ptr1, uint32_t trimmed) { TermFieldMatchData md; SearchContextPtr sc = getSearch<VectorType>(as<VectorType>(ptr1)); - sc->fetchPostings(true); + sc->fetchPostings(queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = sc->createIterator(&md, true); sb->initFullRange(); const PostingInfo *pi = sb->getPostingInfo(); - ASSERT_TRUE(pi != NULL); - const MinMaxPostingInfo *mmpi = - dynamic_cast<const MinMaxPostingInfo *>(pi); - ASSERT_TRUE(mmpi != NULL); + ASSERT_TRUE(pi != nullptr); + const MinMaxPostingInfo *mmpi = dynamic_cast<const MinMaxPostingInfo *>(pi); + ASSERT_TRUE(mmpi != nullptr); if (ptr1->hasMultiValue()) { if (trimmed == 2u) { @@ -909,17 +909,17 @@ PostingListAttributeTest::testMinMax(AttributePtr &ptr1, uint32_t trimmed) EXPECT_EQUAL(1u, sb->getDocId()); sc = getSearch2<VectorType>(as<VectorType>(ptr1)); - sc->fetchPostings(true); + sc->fetchPostings(queryeval::ExecuteInfo::TRUE); sb = sc->createIterator(&md, true); sb->initFullRange(); pi = sb->getPostingInfo(); if (trimmed == 2) { - ASSERT_TRUE(pi == NULL); + ASSERT_TRUE(pi == nullptr); } else { - ASSERT_TRUE(pi != NULL); + ASSERT_TRUE(pi != nullptr); mmpi = dynamic_cast<const MinMaxPostingInfo *>(pi); - ASSERT_TRUE(mmpi != NULL); + ASSERT_TRUE(mmpi != nullptr); if (ptr1->hasMultiValue()) { if (trimmed == 0) { diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp index 7bd755a0f98..491890544e0 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp @@ -211,11 +211,11 @@ Result do_search(IAttributeManager &attribute_manager, const Node &node, bool st TermFieldHandle handle = mdl.allocTermField(fieldId); MatchData::UP match_data = mdl.createMatchData(); Blueprint::UP bp = source.createBlueprint(requestContext, FieldSpec(field, fieldId, handle), node); - ASSERT_TRUE(bp.get() != nullptr); + ASSERT_TRUE(bp); Result result(bp->getState().estimate().estHits, bp->getState().estimate().empty); - bp->fetchPostings(strict); + bp->fetchPostings(queryeval::ExecuteInfo(strict, 1.0)); SearchIterator::UP iterator = bp->createSearch(*match_data, strict); - ASSERT_TRUE(iterator.get() != nullptr); + ASSERT_TRUE(iterator); iterator->initRange(1, num_docs); extract_posting_info(result, iterator->getPostingInfo()); extract_wand_params(result, dynamic_cast<ParallelWeakAndSearch*>(iterator.get())); diff --git a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp index f6a9df54be3..fe5014b6607 100644 --- a/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attribute_weighted_set_blueprint_test.cpp @@ -103,7 +103,7 @@ struct WS { Node::UP node = createNode(); FieldSpecList fields = FieldSpecList().add(FieldSpec(field, fieldId, handle)); queryeval::Blueprint::UP bp = searchable.createBlueprint(requestContext, fields, *node); - bp->fetchPostings(strict); + bp->fetchPostings(queryeval::ExecuteInfo::create(strict)); SearchIterator::UP sb = bp->createSearch(*md, strict); return (dynamic_cast<WeightedSetTermSearch*>(sb.get()) != 0); } @@ -115,7 +115,7 @@ struct WS { Node::UP node = createNode(); FieldSpecList fields = FieldSpecList().add(FieldSpec(field, fieldId, handle)); queryeval::Blueprint::UP bp = searchable.createBlueprint(requestContext, fields, *node); - bp->fetchPostings(strict); + bp->fetchPostings(queryeval::ExecuteInfo::create(strict)); SearchIterator::UP sb = bp->createSearch(*md, strict); FakeResult result; sb->initRange(1, 10); diff --git a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp index 8a63f20822f..e2f21a3d306 100644 --- a/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp +++ b/searchlib/src/tests/attribute/searchable/attributeblueprint_test.cpp @@ -119,7 +119,7 @@ do_search(const Node &node, IAttributeManager &attribute_manager, bool expect_at } else { EXPECT_TRUE(result->get_attribute_search_context() == nullptr); } - result->fetchPostings(true); + result->fetchPostings(queryeval::ExecuteInfo::TRUE); result->setDocIdLimit(DOCID_LIMIT); SearchIterator::UP iterator = result->createSearch(*md, true); assert((bool)iterator); diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp index b518d683409..3b466c5b99d 100644 --- a/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp +++ b/searchlib/src/tests/attribute/searchcontext/searchcontext.cpp @@ -12,6 +12,7 @@ #include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <vespa/searchlib/queryeval/hitcollector.h> #include <vespa/searchlib/queryeval/emptysearch.h> +#include <vespa/searchlib/queryeval/executeinfo.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/vespalib/util/compress.h> #include <vespa/searchlib/test/searchiteratorverifier.h> @@ -204,7 +205,7 @@ private: // test search iterator unpacking void fillForSearchIteratorUnpackingTest(IntegerAttribute * ia, bool extra); void testSearchIteratorUnpacking(const AttributePtr & ptr, SearchContext & sc, bool extra, bool strict) { - sc.fetchPostings(strict); + sc.fetchPostings(queryeval::ExecuteInfo(strict, 1.0)); for (bool withElementId : {false, true}) { testSearchIteratorUnpacking(ptr, sc, extra, strict, withElementId); } @@ -439,7 +440,7 @@ SearchContextTest::performSearch(const V & vec, const T & term, QueryTermSimple: { TermFieldMatchData dummy; SearchContextPtr sc = getSearch(vec, term, termType); - sc->fetchPostings(true); + sc->fetchPostings(queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = sc->createIterator(&dummy, true); ResultSetPtr rs = performSearch(*sb, vec.getNumDocs()); return rs; @@ -495,7 +496,7 @@ SearchContextTest::testFind(const PostingList<V, T> & pl) { { // strict search iterator SearchContextPtr sc = getSearch(pl.getAttribute(), pl.getValue()); - sc->fetchPostings(true); + sc->fetchPostings(queryeval::ExecuteInfo::TRUE); TermFieldMatchData dummy; SearchBasePtr sb = sc->createIterator(&dummy, true); ResultSetPtr rs = performSearch(*sb, pl.getAttribute().getNumDocs()); @@ -624,7 +625,7 @@ public: ~Verifier() override; SearchIterator::UP create(bool strict) const override { - _sc->fetchPostings(strict); + _sc->fetchPostings(queryeval::ExecuteInfo(strict, 1.0)); auto search = _sc->createIterator(&_dummy, strict); if (_withElementId) { search = std::make_unique<attribute::ElementIterator>(std::move(search), *_sc, _dummy); @@ -741,7 +742,7 @@ SearchContextTest::testStrictSearchIterator(SearchContext & threeHits, { TermFieldMatchData dummy; { // search for value with 3 hits - threeHits.fetchPostings(true); + threeHits.fetchPostings(queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = threeHits.createIterator(&dummy, true); sb->initRange(1, threeHits.attribute().getCommittedDocIdLimit()); EXPECT_TRUE(typeTester.matches(*sb)); @@ -762,7 +763,7 @@ SearchContextTest::testStrictSearchIterator(SearchContext & threeHits, } { // search for value with no hits - noHits.fetchPostings(true); + noHits.fetchPostings(queryeval::ExecuteInfo::TRUE); SearchBasePtr sb = noHits.createIterator(&dummy, true); sb->initRange(1, noHits.attribute().getCommittedDocIdLimit()); ASSERT_TRUE(typeTester.matches(*sb)); @@ -780,7 +781,7 @@ SearchContextTest::testNonStrictSearchIterator(SearchContext & threeHits, { TermFieldMatchData dummy; { // search for value with three hits - threeHits.fetchPostings(false); + threeHits.fetchPostings(queryeval::ExecuteInfo::FALSE); SearchBasePtr sb = threeHits.createIterator(&dummy, false); sb->initRange(1, threeHits.attribute().getCommittedDocIdLimit()); EXPECT_TRUE(typeTester.matches(*sb)); @@ -798,7 +799,7 @@ SearchContextTest::testNonStrictSearchIterator(SearchContext & threeHits, EXPECT_TRUE(sb->getDocId() == 5u || sb->isAtEnd()); } { // search for value with no hits - noHits.fetchPostings(false); + noHits.fetchPostings(queryeval::ExecuteInfo::FALSE); SearchBasePtr sb = noHits.createIterator(&dummy, false); sb->initRange(1, threeHits.attribute().getCommittedDocIdLimit()); diff --git a/searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp b/searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp index d34f824d094..243c24f6ab5 100644 --- a/searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp +++ b/searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp @@ -269,13 +269,13 @@ Test::requireThatBlueprintCanCreateSearchIterators() SearchIterator::UP s; { // bit vector due to isFilter b = _index->createBlueprint(_requestContext, FieldSpec("f2", 0, 0, true), makeTerm("w2")); - b->fetchPostings(true); + b->fetchPostings(queryeval::ExecuteInfo::TRUE); s = (dynamic_cast<LeafBlueprint *>(b.get()))->createLeafSearch(mda, true); EXPECT_TRUE(dynamic_cast<BitVectorIterator *>(s.get()) != NULL); } { // bit vector due to no ranking needed b = _index->createBlueprint(_requestContext, FieldSpec("f2", 0, 0, false), makeTerm("w2")); - b->fetchPostings(true); + b->fetchPostings(queryeval::ExecuteInfo::TRUE); s = (dynamic_cast<LeafBlueprint *>(b.get()))->createLeafSearch(mda, true); EXPECT_FALSE(dynamic_cast<BitVectorIterator *>(s.get()) != NULL); TermFieldMatchData md2; @@ -289,7 +289,7 @@ Test::requireThatBlueprintCanCreateSearchIterators() { // fake bit vector b = _index->createBlueprint(_requestContext, FieldSpec("f1", 0, 0, true), makeTerm("w2")); // std::cerr << "BP = " << typeid(*b).name() << std::endl; - b->fetchPostings(true); + b->fetchPostings(queryeval::ExecuteInfo::TRUE); s = (dynamic_cast<LeafBlueprint *>(b.get()))->createLeafSearch(mda, true); // std::cerr << "SI = " << typeid(*s).name() << std::endl; EXPECT_TRUE((dynamic_cast<BooleanMatchIteratorWrapper *>(s.get()) != NULL) || @@ -297,18 +297,15 @@ Test::requireThatBlueprintCanCreateSearchIterators() } { // posting list iterator b = _index->createBlueprint(_requestContext, FieldSpec("f1", 0, 0), makeTerm("w1")); - b->fetchPostings(true); + b->fetchPostings(queryeval::ExecuteInfo::TRUE); s = (dynamic_cast<LeafBlueprint *>(b.get()))->createLeafSearch(mda, true); ASSERT_TRUE((dynamic_cast<ZcRareWordPosOccIterator<true, false> *>(s.get()) != NULL)); } } -Test::Test() : - TestDiskIndex() -{ -} +Test::Test() = default; -Test::~Test() {} +Test::~Test() = default; int Test::Main() diff --git a/searchlib/src/tests/memoryindex/field_index/field_index_iterator_test.cpp b/searchlib/src/tests/memoryindex/field_index/field_index_iterator_test.cpp index 54124326507..71c7c93f756 100644 --- a/searchlib/src/tests/memoryindex/field_index/field_index_iterator_test.cpp +++ b/searchlib/src/tests/memoryindex/field_index/field_index_iterator_test.cpp @@ -2,9 +2,9 @@ #include <vespa/searchcommon/common/schema.h> #include <vespa/searchlib/memoryindex/field_index.h> -#include <vespa/searchlib/memoryindex/posting_iterator.h> #include <vespa/searchlib/test/memoryindex/wrap_inserter.h> #include <vespa/searchlib/test/searchiteratorverifier.h> +#include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <vespa/vespalib/testkit/testapp.h> #include <vespa/log/log.h> diff --git a/searchlib/src/tests/memoryindex/memory_index/memory_index_test.cpp b/searchlib/src/tests/memoryindex/memory_index/memory_index_test.cpp index a320c4a0641..4bb0f91659a 100644 --- a/searchlib/src/tests/memoryindex/memory_index/memory_index_test.cpp +++ b/searchlib/src/tests/memoryindex/memory_index/memory_index_test.cpp @@ -181,7 +181,7 @@ verifyResult(const FakeResult &expect, EXPECT_EQ(expect.inspect().size(), result->getState().estimate().estHits); EXPECT_EQ(expect.inspect().empty(), result->getState().estimate().empty); - result->fetchPostings(true); + result->fetchPostings(search::queryeval::ExecuteInfo::TRUE); SearchIterator::UP search = result->createSearch(*match_data, true); bool valid_search = search.get() != 0; EXPECT_TRUE(valid_search); @@ -452,7 +452,7 @@ TEST(MemoryIndexTest, require_that_we_can_fake_bit_vector) Blueprint::UP res = searchable.createBlueprint(requestContext, fields, makeTerm(foo)); EXPECT_TRUE(res.get() != NULL); - res->fetchPostings(true); + res->fetchPostings(search::queryeval::ExecuteInfo::TRUE); SearchIterator::UP search = res->createSearch(*match_data, true); EXPECT_TRUE(search.get() != NULL); EXPECT_TRUE(dynamic_cast<BooleanMatchIteratorWrapper *>(search.get()) != NULL); diff --git a/searchlib/src/tests/nearsearch/nearsearch_test.cpp b/searchlib/src/tests/nearsearch/nearsearch_test.cpp index ce4864a4326..cb17ea35cf8 100644 --- a/searchlib/src/tests/nearsearch/nearsearch_test.cpp +++ b/searchlib/src/tests/nearsearch/nearsearch_test.cpp @@ -61,7 +61,7 @@ MyTerm::MyTerm(const std::set<uint32_t> &doc, const std::set<uint32_t> &pos) : _docs(doc), _data(pos) {} -MyTerm::~MyTerm() {} +MyTerm::~MyTerm() = default; class MyQuery { private: @@ -230,7 +230,7 @@ Test::testNearSearch(MyQuery &query, uint32_t matchId) } search::fef::MatchData::UP md(layout.createMatchData()); - bp->fetchPostings(true); + bp->fetchPostings(search::queryeval::ExecuteInfo::TRUE); search::queryeval::SearchIterator::UP near = bp->createSearch(*md, true); near->initFullRange(); bool foundMatch = false; diff --git a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp index 72a686fddda..6625a4a09ce 100644 --- a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp +++ b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp @@ -188,7 +188,7 @@ public: SearchIterator::UP Test::create(const Blueprint &blueprint) { - const_cast<Blueprint &>(blueprint).fetchPostings(true); + const_cast<Blueprint &>(blueprint).fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP search = blueprint.createSearch(*_md, true); MySearch::verifyAndInfer(search.get(), *_md); return search; diff --git a/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp b/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp index 9be238edba9..73e523b3df5 100644 --- a/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp +++ b/searchlib/src/tests/queryeval/blueprint/intermediate_blueprints_test.cpp @@ -1047,7 +1047,7 @@ TEST("test WeakAnd Blueprint") { wa.addTerm(Blueprint::UP(new FakeBlueprint(field, z)), 140); wa.addTerm(Blueprint::UP(new FakeBlueprint(field, y)), 130); { - wa.fetchPostings(true); + wa.fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP search = wa.createSearch(*md, true); EXPECT_TRUE(dynamic_cast<WeakAndSearch*>(search.get()) != 0); WeakAndSearch &s = dynamic_cast<WeakAndSearch&>(*search); @@ -1069,7 +1069,7 @@ TEST("test WeakAnd Blueprint") { EXPECT_EQUAL(0u, terms[2].maxScore); // NB: not set } { - wa.fetchPostings(false); + wa.fetchPostings(ExecuteInfo::FALSE); SearchIterator::UP search = wa.createSearch(*md, false); EXPECT_TRUE(dynamic_cast<WeakAndSearch*>(search.get()) != 0); EXPECT_TRUE(search->seek(1)); @@ -1099,7 +1099,7 @@ TEST("require_that_unpack_of_or_over_multisearch_is_optimized") { addChild(std::move(child1)). addChild(std::move(child2)))); MatchData::UP md = MatchData::makeTestInstance(100, 10); - top_up->fetchPostings(false); + top_up->fetchPostings(ExecuteInfo::FALSE); EXPECT_EQUAL("search::queryeval::OrLikeSearch<false, search::queryeval::(anonymous namespace)::FullUnpack>", top_up->createSearch(*md, false)->getClassName()); md->resolveTermField(2)->tagAsNotNeeded(); @@ -1125,7 +1125,7 @@ TEST("require_that_unpack_of_or_is_optimized") { addChild(ap(MyLeafSpec(20).addField(2,2).create())). addChild(ap(MyLeafSpec(10).addField(3,3).create())))); MatchData::UP md = MatchData::makeTestInstance(100, 10); - top_up->fetchPostings(false); + top_up->fetchPostings(ExecuteInfo::FALSE); EXPECT_EQUAL("search::queryeval::OrLikeSearch<false, search::queryeval::(anonymous namespace)::FullUnpack>", top_up->createSearch(*md, false)->getClassName()); md->resolveTermField(2)->tagAsNotNeeded(); @@ -1144,7 +1144,7 @@ TEST("require_that_unpack_of_and_is_optimized") { addChild(ap(MyLeafSpec(20).addField(2,2).create())). addChild(ap(MyLeafSpec(10).addField(3,3).create())))); MatchData::UP md = MatchData::makeTestInstance(100, 10); - top_up->fetchPostings(false); + top_up->fetchPostings(ExecuteInfo::FALSE); EXPECT_EQUAL("search::queryeval::AndSearchNoStrict<search::queryeval::(anonymous namespace)::FullUnpack>", top_up->createSearch(*md, false)->getClassName()); md->resolveTermField(2)->tagAsNotNeeded(); @@ -1164,7 +1164,7 @@ TEST("require_that_unpack_optimization_is_honoured_by_parents") { addChild(ap(MyLeafSpec(20).addField(2,2).create())). addChild(ap(MyLeafSpec(10).addField(3,3).create())))))); MatchData::UP md = MatchData::makeTestInstance(100, 10); - top_up->fetchPostings(false); + top_up->fetchPostings(ExecuteInfo::FALSE); EXPECT_EQUAL("search::queryeval::AndSearchNoStrict<search::queryeval::(anonymous namespace)::FullUnpack>", top_up->createSearch(*md, false)->getClassName()); md->resolveTermField(2)->tagAsNotNeeded(); @@ -1213,7 +1213,7 @@ TEST("require that children does not optimize when parents refuse them to") { FieldSpec("f2", 2, idxth21), makeTerm("w2")), 1.0))); MatchData::UP md = MatchData::makeTestInstance(100, 10); - top_up->fetchPostings(false); + top_up->fetchPostings(ExecuteInfo::FALSE); SearchIterator::UP search = top_up->createSearch(*md, true); EXPECT_EQUAL("search::queryeval::EquivImpl<true>", search->getClassName()); { @@ -1251,7 +1251,7 @@ TEST("require_that_unpack_optimization_is_overruled_by_equiv") { addChild(ap(MyLeafSpec(10).addField(3,idxth3).create()))), 1.0))); MatchData::UP md = MatchData::makeTestInstance(100, 10); - top_up->fetchPostings(false); + top_up->fetchPostings(ExecuteInfo::FALSE); SearchIterator::UP search = top_up->createSearch(*md, true); EXPECT_EQUAL("search::queryeval::EquivImpl<true>", search->getClassName()); { diff --git a/searchlib/src/tests/queryeval/blueprint/leaf_blueprints_test.cpp b/searchlib/src/tests/queryeval/blueprint/leaf_blueprints_test.cpp index 2209ab0bfec..d816e799b59 100644 --- a/searchlib/src/tests/queryeval/blueprint/leaf_blueprints_test.cpp +++ b/searchlib/src/tests/queryeval/blueprint/leaf_blueprints_test.cpp @@ -27,7 +27,7 @@ Test::testEmptyBlueprint() EXPECT_EQUAL(1u, empty.getState().field(0).getFieldId()); EXPECT_EQUAL(11u, empty.getState().field(0).getHandle()); - empty.fetchPostings(true); + empty.fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP search = empty.createSearch(*md, true); SimpleResult res; @@ -45,7 +45,7 @@ Test::testSimpleBlueprint() SimpleBlueprint simple(a); simple.tag("tag"); EXPECT_EQUAL("tag", simple.tag()); - simple.fetchPostings(true); + simple.fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP search = simple.createSearch(*md, true); SimpleResult res; @@ -67,7 +67,7 @@ Test::testFakeBlueprint() TermFieldHandle handle = 0; FakeBlueprint orig(FieldSpec("<field>", fieldId, handle), fake); - orig.fetchPostings(true); + orig.fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP search = orig.createSearch(*md, true); search->initFullRange(); EXPECT_TRUE(!search->seek(1u)); diff --git a/searchlib/src/tests/queryeval/blueprint/mysearch.h b/searchlib/src/tests/queryeval/blueprint/mysearch.h index dbd73b6f40e..73abcce3dc4 100644 --- a/searchlib/src/tests/queryeval/blueprint/mysearch.h +++ b/searchlib/src/tests/queryeval/blueprint/mysearch.h @@ -1,8 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/searchlib/queryeval/blueprint.h> #include <vespa/searchlib/queryeval/multisearch.h> +#include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <vespa/vespalib/objects/visit.hpp> -#include <cassert> namespace search::queryeval { diff --git a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp index f1b6cd05772..7414e8b10f2 100644 --- a/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp +++ b/searchlib/src/tests/queryeval/dot_product/dot_product_test.cpp @@ -58,7 +58,7 @@ struct DP { Node::UP node = createNode(); FieldSpecList fields = FieldSpecList().add(FieldSpec(field, fieldId, handle)); queryeval::Blueprint::UP bp = searchable.createBlueprint(requestContext, fields, *node); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP sb = bp->createSearch(*md, strict); EXPECT_TRUE(dynamic_cast<DotProductSearch*>(sb.get()) != 0); sb->initFullRange(); diff --git a/searchlib/src/tests/queryeval/equiv/equiv_test.cpp b/searchlib/src/tests/queryeval/equiv/equiv_test.cpp index 5dac26fec22..ecd1c8cd218 100644 --- a/searchlib/src/tests/queryeval/equiv/equiv_test.cpp +++ b/searchlib/src/tests/queryeval/equiv/equiv_test.cpp @@ -50,7 +50,7 @@ Test::testEquiv() bool strict = (i == 0); TEST_STATE(strict ? "strict" : "non-strict"); MatchData::UP md = MatchData::makeTestInstance(100, 10); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP search = bp->createSearch(*md, strict); search->initFullRange(); diff --git a/searchlib/src/tests/queryeval/fake_searchable/fake_searchable_test.cpp b/searchlib/src/tests/queryeval/fake_searchable/fake_searchable_test.cpp index 6fc75c8e696..cbad6de25bb 100644 --- a/searchlib/src/tests/queryeval/fake_searchable/fake_searchable_test.cpp +++ b/searchlib/src/tests/queryeval/fake_searchable/fake_searchable_test.cpp @@ -62,7 +62,7 @@ TEST_F(FakeSearchableTest, require_that_term_search_works) { bool strict = (i == 0); SCOPED_TRACE(strict ? "strict" : "non-strict"); MatchData::UP md = MatchData::makeTestInstance(100, 10); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP search = bp->createSearch(*md, strict); search->initFullRange(); @@ -116,7 +116,7 @@ TEST_F(FakeSearchableTest, require_that_phrase_search_works) { bool strict = (i == 0); SCOPED_TRACE(strict ? "strict" : "non-strict"); MatchData::UP md = MatchData::makeTestInstance(100, 10); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP search = bp->createSearch(*md, strict); search->initFullRange(); @@ -167,7 +167,7 @@ TEST_F(FakeSearchableTest, require_that_weigheted_set_search_works) { bool strict = (i == 0); SCOPED_TRACE(strict ? "strict" : "non-strict"); MatchData::UP md = MatchData::makeTestInstance(100, 10); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP search = bp->createSearch(*md, strict); search->initFullRange(); @@ -238,7 +238,7 @@ TEST_F(FakeSearchableTest, require_that_multi_field_search_works) { bool strict = (i == 0); SCOPED_TRACE(strict ? "strict" : "non-strict"); MatchData::UP md = MatchData::makeTestInstance(100, 10); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP search = bp->createSearch(*md, strict); search->initFullRange(); @@ -322,7 +322,7 @@ TEST_F(FakeSearchableTest, require_that_phrase_with_empty_child_works) { bool strict = (i == 0); SCOPED_TRACE(strict ? "strict" : "non-strict"); MatchData::UP md = MatchData::makeTestInstance(100, 10); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP search = bp->createSearch(*md, strict); search->initFullRange(); @@ -342,7 +342,7 @@ TEST_F(FakeSearchableTest, require_that_match_data_is_compressed_for_attributes) fields.add(FieldSpec("attrfoo", 1, 1)); Blueprint::UP bp = source.createBlueprint(req_ctx, fields, termNode); MatchData::UP md = MatchData::makeTestInstance(100, 10); - bp->fetchPostings(false); + bp->fetchPostings(ExecuteInfo::FALSE); SearchIterator::UP search = bp->createSearch(*md, false); search->initFullRange(); EXPECT_TRUE(search->seek(5)); @@ -369,7 +369,7 @@ TEST_F(FakeSearchableTest, require_that_relevant_data_can_be_obtained_from_fake_ fields.add(FieldSpec("attrfoo", 1, 1)); Blueprint::UP bp = source.createBlueprint(req_ctx, fields, termNode); MatchData::UP md = MatchData::makeTestInstance(100, 10); - bp->fetchPostings(false); + bp->fetchPostings(ExecuteInfo::FALSE); SearchIterator::UP search = bp->createSearch(*md, false); EXPECT_TRUE(bp->get_attribute_search_context() != nullptr); const auto *attr_ctx = bp->get_attribute_search_context(); diff --git a/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp b/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp index 607e6100f90..7926a518317 100644 --- a/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp +++ b/searchlib/src/tests/queryeval/parallel_weak_and/parallel_weak_and_test.cpp @@ -175,7 +175,7 @@ struct WandBlueprintSpec Node::UP term = createNode(); Blueprint::UP bp = blueprint(searchable, field, *term); MatchData::UP md(MatchData::makeTestInstance(1, 1)); - bp->fetchPostings(true); + bp->fetchPostings(ExecuteInfo::TRUE); bp->setDocIdLimit(docIdLimit); SearchIterator::UP sb = bp->createSearch(*md, true); EXPECT_TRUE(dynamic_cast<ParallelWeakAndSearch*>(sb.get()) != 0); @@ -190,7 +190,7 @@ struct WandBlueprintSpec FakeResult search(Searchable &searchable, const std::string &field, const search::query::Node &term) const { Blueprint::UP bp = blueprint(searchable, field, term); MatchData::UP md(MatchData::makeTestInstance(1, 1)); - bp->fetchPostings(true); + bp->fetchPostings(ExecuteInfo::TRUE); bp->setDocIdLimit(docIdLimit); SearchIterator::UP sb = bp->createSearch(*md, true); EXPECT_TRUE(dynamic_cast<ParallelWeakAndSearch*>(sb.get()) != 0); diff --git a/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp b/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp index c76873a50cd..28b0d103040 100644 --- a/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp +++ b/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp @@ -26,6 +26,7 @@ using search::query::Weight; using search::queryeval::FieldSpecBase; using search::queryeval::PredicateBlueprint; using search::queryeval::SearchIterator; +using search::queryeval::ExecuteInfo; namespace { @@ -137,7 +138,7 @@ TEST_F("require that blueprint can create search", Fixture) { f.indexDocument(doc_id, annotations); PredicateBlueprint blueprint(f.field, f.guard(), f.query); - blueprint.fetchPostings(true); + blueprint.fetchPostings(ExecuteInfo::TRUE); TermFieldMatchDataArray tfmda; SearchIterator::UP it = blueprint.createLeafSearch(tfmda, true); ASSERT_TRUE(it.get()); @@ -161,7 +162,7 @@ TEST_F("require that blueprint can create more advanced search", Fixture) { f.indexEmptyDocument(doc_id + 2); PredicateBlueprint blueprint(f.field, f.guard(), f.query); - blueprint.fetchPostings(true); + blueprint.fetchPostings(ExecuteInfo::TRUE); TermFieldMatchDataArray tfmda; SearchIterator::UP it = blueprint.createLeafSearch(tfmda, true); ASSERT_TRUE(it.get()); @@ -184,7 +185,7 @@ TEST_F("require that blueprint can create NOT search", Fixture) { f.indexDocument(doc_id, annotations); PredicateBlueprint blueprint(f.field, f.guard(), f.query); - blueprint.fetchPostings(true); + blueprint.fetchPostings(ExecuteInfo::TRUE); TermFieldMatchDataArray tfmda; SearchIterator::UP it = blueprint.createLeafSearch(tfmda, true); ASSERT_TRUE(it.get()); @@ -200,7 +201,7 @@ TEST_F("require that blueprint can create compressed NOT search", Fixture) { f.indexDocument(doc_id, annotations); PredicateBlueprint blueprint(f.field, f.guard(), f.query); - blueprint.fetchPostings(true); + blueprint.fetchPostings(ExecuteInfo::TRUE); TermFieldMatchDataArray tfmda; SearchIterator::UP it = blueprint.createLeafSearch(tfmda, true); ASSERT_TRUE(it.get()); @@ -224,7 +225,7 @@ TEST_F("require that blueprint can set up search with subqueries", Fixture) { query.getTerm()->addFeature("key2", "value", 2); PredicateBlueprint blueprint(f.field, f.guard(), query); - blueprint.fetchPostings(true); + blueprint.fetchPostings(ExecuteInfo::TRUE); TermFieldMatchDataArray tfmda; SearchIterator::UP it = blueprint.createLeafSearch(tfmda, true); ASSERT_TRUE(it.get()); diff --git a/searchlib/src/tests/queryeval/queryeval.cpp b/searchlib/src/tests/queryeval/queryeval.cpp index 56c6f7e1282..26e7095dd60 100644 --- a/searchlib/src/tests/queryeval/queryeval.cpp +++ b/searchlib/src/tests/queryeval/queryeval.cpp @@ -225,7 +225,7 @@ TEST("testAnd") { auto and_b = std::make_unique<AndBlueprint>(); and_b->addChild(std::make_unique<SimpleBlueprint>(a)); and_b->addChild(std::make_unique<SimpleBlueprint>(b)); - and_b->fetchPostings(true); + and_b->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP and_ab = and_b->createSearch(*md, true); EXPECT_TRUE(dynamic_cast<const AndSearch *>(and_ab.get()) != nullptr); @@ -252,7 +252,7 @@ TEST("testOr") { auto or_b = std::make_unique<OrBlueprint>(); or_b->addChild(std::make_unique<SimpleBlueprint>(a)); or_b->addChild(std::make_unique<SimpleBlueprint>(b)); - or_b->fetchPostings(true); + or_b->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP or_ab = or_b->createSearch(*md, true); SimpleResult res; @@ -366,7 +366,7 @@ TEST("testAndNot") { auto andnot_b = std::make_unique<AndNotBlueprint>(); andnot_b->addChild(std::make_unique<SimpleBlueprint>(a)); andnot_b->addChild(std::make_unique<SimpleBlueprint>(b)); - andnot_b->fetchPostings(true); + andnot_b->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP andnot_ab = andnot_b->createSearch(*md, true); SimpleResult res; @@ -386,7 +386,7 @@ TEST("testAndNot") { auto andnot_b = std::make_unique<AndNotBlueprint>(); andnot_b->addChild(std::make_unique<SimpleBlueprint>(a)); andnot_b->addChild(std::make_unique<DummySingleValueBitNumericAttributeBlueprint>(b)); - andnot_b->fetchPostings(true); + andnot_b->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP andnot_ab = andnot_b->createSearch(*md, true); SimpleResult res; @@ -412,7 +412,7 @@ TEST("testAndNot") { auto and_b = std::make_unique<AndBlueprint>(); and_b->addChild(std::make_unique<SimpleBlueprint>(c)); and_b->addChild(std::move(andnot_b)); - and_b->fetchPostings(true); + and_b->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP and_cab = and_b->createSearch(*md, true); SimpleResult res; @@ -437,7 +437,7 @@ TEST("testRank") { auto rank_b = std::make_unique<RankBlueprint>(); rank_b->addChild(std::make_unique<SimpleBlueprint>(a)); rank_b->addChild(std::make_unique<SimpleBlueprint>(b)); - rank_b->fetchPostings(true); + rank_b->fetchPostings(ExecuteInfo::TRUE); SearchIterator::UP rank_ab = rank_b->createSearch(*md, true); SimpleResult res; diff --git a/searchlib/src/tests/queryeval/same_element/same_element_test.cpp b/searchlib/src/tests/queryeval/same_element/same_element_test.cpp index a4ca1ade999..378e16480b8 100644 --- a/searchlib/src/tests/queryeval/same_element/same_element_test.cpp +++ b/searchlib/src/tests/queryeval/same_element/same_element_test.cpp @@ -37,7 +37,7 @@ std::unique_ptr<SameElementBlueprint> make_blueprint(const std::vector<FakeResul Blueprint::UP finalize(Blueprint::UP bp, bool strict) { Blueprint::UP result = Blueprint::optimize(std::move(bp)); - result->fetchPostings(strict); + result->fetchPostings(ExecuteInfo::create(strict)); result->freeze(); return result; } diff --git a/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp b/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp index 0743ac8408d..abaae7e4333 100644 --- a/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp +++ b/searchlib/src/tests/queryeval/simple_phrase/simple_phrase_test.cpp @@ -138,12 +138,13 @@ public: void fetchPostings(bool useBlueprint) { + ExecuteInfo execInfo = ExecuteInfo::create(_strict); if (useBlueprint) { - _phrase.fetchPostings(_strict); + _phrase.fetchPostings(execInfo); return; } for (size_t i = 0; i < _children.size(); ++i) { - _children[i]->fetchPostings(_strict); + _children[i]->fetchPostings(execInfo); } } diff --git a/searchlib/src/tests/queryeval/sourceblender/sourceblender.cpp b/searchlib/src/tests/queryeval/sourceblender/sourceblender.cpp index 2cd687ab23a..c02bea9c5df 100644 --- a/searchlib/src/tests/queryeval/sourceblender/sourceblender.cpp +++ b/searchlib/src/tests/queryeval/sourceblender/sourceblender.cpp @@ -73,7 +73,7 @@ TEST("test strictness") { blend_b->addChild(std::move(a_b)); blend_b->addChild(std::move(b_b)); Blueprint::UP bp(blend_b); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP search = bp->createSearch(*md, strict); search->initFullRange(); SearchIterator &blend = *search; diff --git a/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp b/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp index 78195f19427..85d2f3f4a37 100644 --- a/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp +++ b/searchlib/src/tests/queryeval/weighted_set_term/weighted_set_term_test.cpp @@ -66,7 +66,7 @@ struct WS { Node::UP node = createNode(); FieldSpecList fields = FieldSpecList().add(FieldSpec(field, fieldId, handle)); queryeval::Blueprint::UP bp = searchable.createBlueprint(requestContext, fields, *node); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP sb = bp->createSearch(*md, strict); return (dynamic_cast<WeightedSetTermSearch*>(sb.get()) != 0); } @@ -77,7 +77,7 @@ struct WS { Node::UP node = createNode(); FieldSpecList fields = FieldSpecList().add(FieldSpec(field, fieldId, handle)); queryeval::Blueprint::UP bp = searchable.createBlueprint(requestContext, fields, *node); - bp->fetchPostings(strict); + bp->fetchPostings(ExecuteInfo::create(strict)); SearchIterator::UP sb = bp->createSearch(*md, strict); sb->initFullRange(); FakeResult result; diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp index 29298a05d6e..d8e9c442940 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp @@ -139,8 +139,8 @@ public: } void - fetchPostings(bool strict) override { - _search_context->fetchPostings(strict); + fetchPostings(const queryeval::ExecuteInfo &execInfo) override { + _search_context->fetchPostings(execInfo); } void visitMembers(vespalib::ObjectVisitor &visitor) const override; @@ -219,9 +219,9 @@ public: } } - void fetchPostings(bool strict) override { + void fetchPostings(const queryeval::ExecuteInfo &execInfo) override { for (size_t i(0); i < _rangeSearches.size(); i++) { - _rangeSearches[i]->fetchPostings(strict); + _rangeSearches[i]->fetchPostings(execInfo); } } }; diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp index 9195ce30c6e..9f9d5535014 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.cpp @@ -178,11 +178,11 @@ AttributeWeightedSetBlueprint::createLeafSearch(const fef::TermFieldMatchDataArr } void -AttributeWeightedSetBlueprint::fetchPostings(bool strict) +AttributeWeightedSetBlueprint::fetchPostings(const queryeval::ExecuteInfo &execInfo) { - if (strict) { + if (execInfo.isStrict()) { for (auto * context : _contexts) { - context->fetchPostings(true); + context->fetchPostings(execInfo); } } } diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.h b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.h index d66a544e77a..6af3405c91d 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.h +++ b/searchlib/src/vespa/searchlib/attribute/attribute_weighted_set_blueprint.h @@ -29,7 +29,7 @@ public: ~AttributeWeightedSetBlueprint(); void addToken(std::unique_ptr<ISearchContext> context, int32_t weight); queryeval::SearchIterator::UP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override; - void fetchPostings(bool strict) override; + void fetchPostings(const queryeval::ExecuteInfo &execInfo) override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; }; diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp index 4c060c5fab8..b043bb4aaf8 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp @@ -526,9 +526,9 @@ createFilterIterator(fef::TermFieldMatchData *matchData, bool strict) void -AttributeVector::SearchContext::fetchPostings(bool strict) { +AttributeVector::SearchContext::fetchPostings(const queryeval::ExecuteInfo &execInfo) { if (_plsc != nullptr) - _plsc->fetchPostings(strict); + _plsc->fetchPostings(execInfo); } diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index 48ef8257329..b5f6beaa718 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -522,7 +522,7 @@ public: unsigned int approximateHits() const override; queryeval::SearchIterator::UP createIterator(fef::TermFieldMatchData *matchData, bool strict) override; - void fetchPostings(bool strict) override; + void fetchPostings(const queryeval::ExecuteInfo &execInfo) override; bool valid() const override { return false; } Int64Range getAsIntegerTerm() const override { return Int64Range(); } const QueryTermUCS4 * queryTerm() const override { diff --git a/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.cpp b/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.cpp index 28a270555d3..3b9f3d6f47c 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.cpp +++ b/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.cpp @@ -39,9 +39,8 @@ EnumHintSearchContext::lookupRange(const datastore::EntryComparator &low, } void -EnumHintSearchContext::fetchPostings(bool strict) +EnumHintSearchContext::fetchPostings(const queryeval::ExecuteInfo &) { - (void) strict; } SearchIterator::UP diff --git a/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.h b/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.h index 5a20318ae7b..b83ea2e6c46 100644 --- a/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.h +++ b/searchlib/src/vespa/searchlib/attribute/enumhintsearchcontext.h @@ -28,7 +28,7 @@ protected: EnumHintSearchContext(const IEnumStoreDictionary &dictionary, uint32_t docIdLimit, uint64_t numValues); - ~EnumHintSearchContext(); + ~EnumHintSearchContext() override; void lookupTerm(const datastore::EntryComparator &comp); void lookupRange(const datastore::EntryComparator &low, const datastore::EntryComparator &high); @@ -36,7 +36,7 @@ protected: queryeval::SearchIterator::UP createPostingIterator(fef::TermFieldMatchData *matchData, bool strict) override; - void fetchPostings(bool strict) override; + void fetchPostings(const queryeval::ExecuteInfo & execInfo) override; unsigned int approximateHits() const override; }; diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp index 49ae5209aa0..0251e9c945c 100644 --- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp +++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp @@ -7,6 +7,7 @@ #include <vespa/searchlib/common/bitvectoriterator.h> #include <vespa/searchlib/query/query_term_ucs4.h> #include <vespa/searchlib/queryeval/emptysearch.h> +#include <vespa/searchlib/queryeval/executeinfo.h> #include "attributeiterators.hpp" #include <vespa/log/log.h> @@ -230,12 +231,12 @@ ImportedSearchContext::considerAddSearchCacheEntry() } } -void ImportedSearchContext::fetchPostings(bool strict) { +void ImportedSearchContext::fetchPostings(const queryeval::ExecuteInfo &execInfo) { assert(!_fetchPostingsDone); _fetchPostingsDone = true; if (!_searchCacheLookup) { - _target_search_context->fetchPostings(strict); - if (strict || _target_attribute.getIsFastSearch()) { + _target_search_context->fetchPostings(execInfo); + if (execInfo.isStrict() || _target_attribute.getIsFastSearch()) { makeMergedPostings(_target_attribute.getIsFilter()); considerAddSearchCacheEntry(); } diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.h b/searchlib/src/vespa/searchlib/attribute/imported_search_context.h index 2ceb61bc2b2..2663978c99a 100644 --- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.h +++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.h @@ -56,7 +56,7 @@ public: std::unique_ptr<queryeval::SearchIterator> createIterator(fef::TermFieldMatchData* matchData, bool strict) override; unsigned int approximateHits() const override; - void fetchPostings(bool strict) override; + void fetchPostings(const queryeval::ExecuteInfo &execInfo) override; bool valid() const override; Int64Range getAsIntegerTerm() const override; const QueryTermUCS4 * queryTerm() const override; diff --git a/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.h b/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.h index 097cc35d8cb..674b2fcc8c7 100644 --- a/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.h +++ b/searchlib/src/vespa/searchlib/attribute/ipostinglistsearchcontext.h @@ -4,7 +4,10 @@ #include <memory> -namespace search::queryeval { class SearchIterator; } +namespace search::queryeval { + class SearchIterator; + class ExecuteInfo; +} namespace search::fef { class TermFieldMatchData; } namespace search::attribute { @@ -25,7 +28,7 @@ protected: virtual ~IPostingListSearchContext() { } public: - virtual void fetchPostings(bool strict) = 0; + virtual void fetchPostings(const queryeval::ExecuteInfo & execInfo) = 0; virtual std::unique_ptr<queryeval::SearchIterator> createPostingIterator(fef::TermFieldMatchData *matchData, bool strict) = 0; virtual unsigned int approximateHits() const = 0; }; diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h index 78778e8085a..bd25cde4ff6 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h +++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h @@ -116,14 +116,14 @@ protected: PostingListSearchContextT(const Dictionary &dictionary, uint32_t docIdLimit, uint64_t numValues, bool hasWeight, const PostingList &postingList, const IEnumStore &esb, uint32_t minBvCocFreq, bool useBitVector, const ISearchContext &baseSearchCtx); - ~PostingListSearchContextT(); + ~PostingListSearchContextT() override; void lookupSingle(); size_t countHits() const; void fillArray(); void fillBitVector(); - void fetchPostings(bool strict) override; + void fetchPostings(const queryeval::ExecuteInfo & strict) override; // this will be called instead of the fetchPostings function in some cases void diversify(bool forward, size_t wanted_hits, const IAttributeVector &diversity_attr, size_t max_per_group, size_t cutoff_groups, bool cutoff_strict); @@ -229,7 +229,7 @@ private: ? limit : estimate; } - void fetchPostings(bool strict) override { + void fetchPostings(const queryeval::ExecuteInfo & execInfo) override { if (params().diversityAttribute() != nullptr) { bool forward = (this->getRangeLimit() > 0); size_t wanted_hits = std::abs(this->getRangeLimit()); @@ -237,7 +237,7 @@ private: *(params().diversityAttribute()), this->getMaxPerGroup(), params().diversityCutoffGroups(), params().diversityCutoffStrict()); } else { - PostingListSearchContextT<DataT>::fetchPostings(strict); + PostingListSearchContextT<DataT>::fetchPostings(execInfo); } } @@ -267,7 +267,7 @@ PostingSearchContext(QueryTermSimpleUP qTerm, bool useBitVector, const AttrT &to } template <typename BaseSC, typename BaseSC2, typename AttrT> -PostingSearchContext<BaseSC, BaseSC2, AttrT>::~PostingSearchContext() { } +PostingSearchContext<BaseSC, BaseSC2, AttrT>::~PostingSearchContext() = default; template <typename BaseSC, typename AttrT, typename DataT> diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp index ed6a4a06478..e60cd4f5887 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp +++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.hpp @@ -6,10 +6,11 @@ #include "attributeiterators.h" #include "diversity.h" #include "postingstore.hpp" +#include "posting_list_traverser.h" #include <vespa/searchlib/queryeval/emptysearch.h> +#include <vespa/searchlib/queryeval/executeinfo.h> #include <vespa/searchlib/common/bitvectoriterator.h> #include <vespa/searchlib/common/growablebitvector.h> -#include "posting_list_traverser.h" using search::queryeval::EmptySearch; @@ -113,7 +114,7 @@ PostingListSearchContextT<DataT>::fillBitVector() template <typename DataT> void -PostingListSearchContextT<DataT>::fetchPostings(bool strict) +PostingListSearchContextT<DataT>::fetchPostings(const queryeval::ExecuteInfo & execInfo) { if (_fetchPostingsDone) return; @@ -121,7 +122,7 @@ PostingListSearchContextT<DataT>::fetchPostings(bool strict) if (_uniqueValues < 2u) return; - if (strict && !fallbackToFiltering()) { + if (execInfo.isStrict() && !fallbackToFiltering()) { size_t sum(countHits()); if (sum < _docIdLimit / 64) { _merger.reserveArray(_uniqueValues, sum); diff --git a/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp index bb930e303b6..e1277653b83 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp @@ -127,7 +127,7 @@ public: std::unique_ptr<queryeval::SearchIterator> createFilterIterator(fef::TermFieldMatchData * matchData, bool strict) override; - void fetchPostings(bool strict) override; + void fetchPostings(const queryeval::ExecuteInfo &execInfo) override; std::unique_ptr<queryeval::SearchIterator> createPostingIterator(fef::TermFieldMatchData *matchData, bool strict) override; unsigned int approximateHits() const override; }; @@ -157,8 +157,8 @@ BitVectorSearchContext::createFilterIterator(fef::TermFieldMatchData * matchData } void -BitVectorSearchContext::fetchPostings(bool strict) { - (void) strict; +BitVectorSearchContext::fetchPostings(const queryeval::ExecuteInfo &execInfo) { + (void) execInfo; } std::unique_ptr<queryeval::SearchIterator> diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp index 194aea5344b..4febe165665 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.cpp @@ -66,9 +66,9 @@ areAnyParentsEquiv(const Blueprint * node) } void -DiskTermBlueprint::fetchPostings(bool strict) +DiskTermBlueprint::fetchPostings(const queryeval::ExecuteInfo &execInfo) { - (void) strict; + (void) execInfo; _hasEquivParent = areAnyParentsEquiv(getParent()); _bitVector = _diskIndex.readBitVector(*_lookupRes); if (!_useBitVector || !_bitVector) { diff --git a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h index f3e9a29dca0..39ac27bc448 100644 --- a/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h +++ b/searchlib/src/vespa/searchlib/diskindex/disktermblueprint.h @@ -40,7 +40,7 @@ public: // For now, this DiskTermBlueprint instance must have longer lifetime than the created iterator. std::unique_ptr<queryeval::SearchIterator> createLeafSearch(const fef::TermFieldMatchDataArray & tfmda, bool strict) const override; - void fetchPostings(bool strict) override; + void fetchPostings(const queryeval::ExecuteInfo &execInfo) override; }; } diff --git a/searchlib/src/vespa/searchlib/queryeval/CMakeLists.txt b/searchlib/src/vespa/searchlib/queryeval/CMakeLists.txt index d8774d86edf..de2919443ff 100644 --- a/searchlib/src/vespa/searchlib/queryeval/CMakeLists.txt +++ b/searchlib/src/vespa/searchlib/queryeval/CMakeLists.txt @@ -12,6 +12,7 @@ vespa_add_library(searchlib_queryeval OBJECT emptysearch.cpp equiv_blueprint.cpp equivsearch.cpp + executeinfo.cpp fake_requestcontext.cpp fake_result.cpp fake_search.cpp diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp index 1019ef9dd68..0a4d10742f7 100644 --- a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp @@ -3,7 +3,7 @@ #include "blueprint.h" #include "leaf_blueprints.h" #include "intermediate_blueprints.h" -#include "equiv_blueprint.h" +#include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <vespa/vespalib/objects/visit.hpp> #include <vespa/vespalib/objects/objectdumper.h> #include <vespa/vespalib/objects/object2slime.h> @@ -403,11 +403,11 @@ IntermediateBlueprint::visitMembers(vespalib::ObjectVisitor &visitor) const } void -IntermediateBlueprint::fetchPostings(bool strict) +IntermediateBlueprint::fetchPostings(const ExecuteInfo &execInfo) { for (size_t i = 0; i < _children.size(); ++i) { - bool strictChild = (strict && inheritStrict(i)); - _children[i]->fetchPostings(strictChild); + ExecuteInfo childInfo = ExecuteInfo(execInfo.isStrict() && inheritStrict(i), execInfo.hitRate()); + _children[i]->fetchPostings(childInfo); } } @@ -494,9 +494,9 @@ LeafBlueprint::LeafBlueprint(const FieldSpecBaseList &fields, bool allow_termwis LeafBlueprint::~LeafBlueprint() = default; void -LeafBlueprint::fetchPostings(bool strict) +LeafBlueprint::fetchPostings(const ExecuteInfo &execInfo) { - (void) strict; + (void) execInfo; } void diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.h b/searchlib/src/vespa/searchlib/queryeval/blueprint.h index 383e63a2edd..842cd7f30ea 100644 --- a/searchlib/src/vespa/searchlib/queryeval/blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.h @@ -4,10 +4,11 @@ #include "field_spec.h" #include "unpackinfo.h" +#include "executeinfo.h" #include <vespa/searchlib/fef/handle.h> #include <vespa/searchlib/fef/matchdata.h> #include <vespa/searchlib/fef/termfieldmatchdata.h> -#include <vespa/searchlib/fef/termfieldmatchdataarray.h> +#include <cassert> namespace vespalib { class ObjectVisitor; } namespace vespalib::slime { @@ -15,10 +16,12 @@ namespace vespalib::slime { struct Inserter; } namespace search::attribute { class ISearchContext; } +namespace search::fef { class TermFieldMatchDataArray; } namespace search::queryeval { class SearchIterator; +class ExecuteInfo; /** * A Blueprint is an intermediate representation of a search. More @@ -186,7 +189,7 @@ public: double hit_ratio() const { return getState().hit_ratio(_docid_limit); } - virtual void fetchPostings(bool strict) = 0; + virtual void fetchPostings(const ExecuteInfo &execInfo) = 0; virtual void freeze() = 0; bool frozen() const { return _frozen; } @@ -288,7 +291,7 @@ public: bool strict, fef::MatchData &md) const = 0; void visitMembers(vespalib::ObjectVisitor &visitor) const override; - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; void freeze() override final; UnpackInfo calculateUnpackInfo(const fef::MatchData & md) const; @@ -313,7 +316,7 @@ public: ~LeafBlueprint() override; const State &getState() const override final { return _state; } void setDocIdLimit(uint32_t limit) override final { Blueprint::setDocIdLimit(limit); } - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; void freeze() override final; SearchIteratorUP createSearch(fef::MatchData &md, bool strict) const override; diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp index f76cd0d6acc..d8bb31525e9 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.cpp @@ -64,11 +64,11 @@ DotProductBlueprint::createLeafSearch(const search::fef::TermFieldMatchDataArray } void -DotProductBlueprint::fetchPostings(bool strict) +DotProductBlueprint::fetchPostings(const ExecuteInfo &execInfo) { - (void) strict; + ExecuteInfo childInfo(true, execInfo.hitRate()); for (size_t i = 0; i < _terms.size(); ++i) { - _terms[i]->fetchPostings(true); + _terms[i]->fetchPostings(childInfo); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h index e19a6cdb7f9..86c8e90300a 100644 --- a/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/dot_product_blueprint.h @@ -34,7 +34,7 @@ public: bool strict) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; }; } diff --git a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp index bdd64f4c938..8e067596adf 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.cpp @@ -47,10 +47,10 @@ EquivBlueprint::visitMembers(vespalib::ObjectVisitor &visitor) const } void -EquivBlueprint::fetchPostings(bool strict) +EquivBlueprint::fetchPostings(const ExecuteInfo &execInfo) { for (size_t i = 0; i < _terms.size(); ++i) { - _terms[i]->fetchPostings(strict); + _terms[i]->fetchPostings(execInfo); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h index 09a41ab13df..59ed5ad5d3d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/equiv_blueprint.h @@ -27,7 +27,7 @@ public: SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; bool isEquiv() const override { return true; } }; diff --git a/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp b/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp new file mode 100644 index 00000000000..b549876435f --- /dev/null +++ b/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp @@ -0,0 +1,15 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "executeinfo.h" + +namespace search::queryeval { + +const ExecuteInfo ExecuteInfo::TRUE(true, 1.0); +const ExecuteInfo ExecuteInfo::FALSE(true, 1.0); + +ExecuteInfo +ExecuteInfo::create(bool strict) { + return ExecuteInfo(strict, 1.0); +} + +} diff --git a/searchlib/src/vespa/searchlib/queryeval/executeinfo.h b/searchlib/src/vespa/searchlib/queryeval/executeinfo.h new file mode 100644 index 00000000000..4f2b9ecab98 --- /dev/null +++ b/searchlib/src/vespa/searchlib/queryeval/executeinfo.h @@ -0,0 +1,27 @@ +// Copyright 2019 Oath inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +namespace search::queryeval { + + /** + * Holds information about how query will be executed and how large part of corpus will pass through. + * @author baldersheim + */ +class ExecuteInfo { +public: + ExecuteInfo(bool strict, float hitRate_in) + : _hitRate(hitRate_in), + _strict(strict) + { } + bool isStrict() const { return _strict; } + float hitRate() const { return _hitRate; } + static const ExecuteInfo TRUE; + static const ExecuteInfo FALSE; + static ExecuteInfo create(bool strict); +private: + float _hitRate; + bool _strict; +}; + +} diff --git a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp index 4fb1f44e156..94cec9a63c5 100644 --- a/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/leaf_blueprints.cpp @@ -87,7 +87,7 @@ struct FakeContext : attribute::ISearchContext { } unsigned int approximateHits() const override { return 0; } std::unique_ptr<SearchIterator> createIterator(fef::TermFieldMatchData *, bool) override { abort(); } - void fetchPostings(bool) override { } + void fetchPostings(const ExecuteInfo &) override { } bool valid() const override { return true; } search::Int64Range getAsIntegerTerm() const override { abort(); } const search::QueryTermUCS4 * queryTerm() const override { abort(); } diff --git a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp index 6a844a6bec0..8be6263221a 100644 --- a/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/nearest_neighbor_blueprint.cpp @@ -3,6 +3,7 @@ #include "emptysearch.h" #include "nearest_neighbor_blueprint.h" #include "nearest_neighbor_iterator.h" +#include <vespa/searchlib/fef/termfieldmatchdataarray.h> #include <vespa/eval/tensor/dense/dense_tensor_view.h> #include <vespa/searchlib/tensor/dense_tensor_attribute.h> diff --git a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp index 3fd08047922..805d3246460 100644 --- a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.cpp @@ -233,7 +233,7 @@ namespace { } -void PredicateBlueprint::fetchPostings(bool) { +void PredicateBlueprint::fetchPostings(const ExecuteInfo &) { const auto &interval_index = _index.getIntervalIndex(); const auto &bounds_index = _index.getBoundsIndex(); lookupPostingLists(_interval_dict_entries, _interval_vector_iterators, diff --git a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.h index 16b725cd4b0..3c85978798a 100644 --- a/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/predicate_blueprint.h @@ -47,7 +47,7 @@ public: const query::PredicateQuery &query); ~PredicateBlueprint(); - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; SearchIterator::UP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, diff --git a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp index 8ca8ef0f102..fe4619b16db 100644 --- a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp @@ -54,10 +54,11 @@ SameElementBlueprint::optimize_self() } void -SameElementBlueprint::fetchPostings(bool strict) +SameElementBlueprint::fetchPostings(const ExecuteInfo &execInfo) { for (size_t i = 0; i < _terms.size(); ++i) { - _terms[i]->fetchPostings(strict && (i == 0)); + ExecuteInfo childInfo(execInfo.isStrict() && (i == 0), execInfo.hitRate()); + _terms[i]->fetchPostings(childInfo); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.h index e6fe9f8929c..fc19abe4c5e 100644 --- a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.h @@ -35,7 +35,7 @@ public: void addTerm(Blueprint::UP term); void optimize_self() override; - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; std::unique_ptr<SameElementSearch> create_same_element_search(bool strict) const; SearchIteratorUP createLeafSearch(const search::fef::TermFieldMatchDataArray &tfmda, diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp index edb26fdb296..81e90c399ec 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.cpp @@ -81,10 +81,10 @@ SimplePhraseBlueprint::createLeafSearch(const fef::TermFieldMatchDataArray &tfmd void -SimplePhraseBlueprint::fetchPostings(bool strict) +SimplePhraseBlueprint::fetchPostings(const ExecuteInfo &execInfo) { for (auto & term : _terms) { - term->fetchPostings(strict); + term->fetchPostings(execInfo); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h index a09bc3f6c06..0fb1599d68f 100644 --- a/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/simple_phrase_blueprint.h @@ -36,7 +36,7 @@ public: SearchIteratorUP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; }; } diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp index bf98a9f5880..a0010c7a8f0 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.cpp @@ -103,10 +103,11 @@ ParallelWeakAndBlueprint::createLeafSearch(const search::fef::TermFieldMatchData } void -ParallelWeakAndBlueprint::fetchPostings(bool) +ParallelWeakAndBlueprint::fetchPostings(const ExecuteInfo & execInfo) { + ExecuteInfo childInfo(true, execInfo.hitRate()); for (size_t i = 0; i < _terms.size(); ++i) { - _terms[i]->fetchPostings(true); + _terms[i]->fetchPostings(childInfo); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h index 6bc4da64379..a59cdb8cbf5 100644 --- a/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/wand/parallel_weak_and_blueprint.h @@ -61,7 +61,7 @@ public: SearchIterator::UP createLeafSearch(const fef::TermFieldMatchDataArray &tfmda, bool strict) const override; void visitMembers(vespalib::ObjectVisitor &visitor) const override; - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; bool always_needs_unpack() const override; }; diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp index cec72129475..b603fd8fee4 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.cpp @@ -56,11 +56,11 @@ WeightedSetTermBlueprint::createLeafSearch(const fef::TermFieldMatchDataArray &t } void -WeightedSetTermBlueprint::fetchPostings(bool strict) +WeightedSetTermBlueprint::fetchPostings(const ExecuteInfo &execInfo) { - (void) strict; + ExecuteInfo childInfo(true, execInfo.hitRate()); for (size_t i = 0; i < _terms.size(); ++i) { - _terms[i]->fetchPostings(true); + _terms[i]->fetchPostings(childInfo); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h index 19e88466b1a..8ae42607a9d 100644 --- a/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h +++ b/searchlib/src/vespa/searchlib/queryeval/weighted_set_term_blueprint.h @@ -37,7 +37,7 @@ public: void visitMembers(vespalib::ObjectVisitor &visitor) const override; private: - void fetchPostings(bool strict) override; + void fetchPostings(const ExecuteInfo &execInfo) override; }; } |