summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-12-04 15:33:25 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-12-04 15:33:25 +0000
commit989b472666ae79b9d55adcec85833ab17b9dc942 (patch)
treeac520d42e8954cc6ede8b870dfe5c778ee9eefae /searchcore
parent70d6cc8ac0ef95d839054a7bf6a8c013cc3cb618 (diff)
- Control creation of temporary postinglists during fetchPostings for non-strict iterators.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/matching/query_test.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/query.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/query.h3
5 files changed, 13 insertions, 9 deletions
diff --git a/searchcore/src/tests/proton/matching/query_test.cpp b/searchcore/src/tests/proton/matching/query_test.cpp
index cb24d8bc407..bf574af725d 100644
--- a/searchcore/src/tests/proton/matching/query_test.cpp
+++ b/searchcore/src/tests/proton/matching/query_test.cpp
@@ -713,7 +713,7 @@ void Test::requireThatQueryGluesEverythingTogether() {
EXPECT_EQUAL(1u, md->getNumTermFields());
query.optimize();
- query.fetchPostings(ExecuteInfo::create(true, 1.0F, &requestContext.getDoom()));
+ query.fetchPostings(ExecuteInfo::TRUE);
SearchIterator::UP search = query.createSearch(*md);
ASSERT_TRUE(search.get());
}
@@ -746,7 +746,7 @@ void checkQueryAddsLocation(const string &loc_in, const string &loc_out) {
MatchData::UP md = mdl.createMatchData();
EXPECT_EQUAL(2u, md->getNumTermFields());
- query.fetchPostings(ExecuteInfo::create(true, 1.0F, &requestContext.getDoom()));
+ query.fetchPostings(ExecuteInfo::TRUE);
SearchIterator::UP search = query.createSearch(*md);
ASSERT_TRUE(search.get());
if (!EXPECT_NOT_EQUAL(string::npos, search->asString().find(loc_out))) {
@@ -968,7 +968,7 @@ Test::requireThatWhiteListBlueprintCanBeUsed()
MatchData::UP md = mdl.createMatchData();
query.optimize();
- query.fetchPostings(ExecuteInfo::create(true, 1.0F, &requestContext.getDoom()));
+ query.fetchPostings(ExecuteInfo::TRUE);
SearchIterator::UP search = query.createSearch(*md);
SimpleResult exp = SimpleResult().addHit(1).addHit(5).addHit(7).addHit(11);
SimpleResult act;
diff --git a/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp b/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp
index d07169a0d63..349d33e03e9 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp
@@ -99,7 +99,7 @@ AttributeLimiter::create_match_data(size_t want_hits, size_t max_group_size, dou
FieldSpecList field; // single field API is protected
field.add(FieldSpec(_attribute_name, my_field_id, my_handle));
_blueprint = _searchable_attributes.createBlueprint(_requestContext, field, node);
- auto execInfo = ExecuteInfo::create(strictSearch, strictSearch ? 1.0F : hit_rate, &_requestContext.getDoom());
+ auto execInfo = ExecuteInfo::create(strictSearch, strictSearch ? 1.0F : hit_rate, &_requestContext.getDoom(), true);
_blueprint->fetchPostings(execInfo);
_estimatedHits.store(_blueprint->getState().estimate().estHits, std::memory_order_relaxed);
_blueprint->freeze();
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
index 7beecaca613..521e4ffdbe2 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp
@@ -204,12 +204,14 @@ MatchToolsFactory(QueryLimiter & queryLimiter,
_query.optimize();
trace.addEvent(4, "Perform dictionary lookups and posting lists initialization");
float hitRate = std::min(1.0F, float(maxNumHits)/float(searchContext.getDocIdLimit()));
- _query.fetchPostings(search::queryeval::ExecuteInfo::create(is_search, hitRate, &_requestContext.getDoom()));
+ bool create_postinglist_when_non_strict = CreatePostingListWithNonStrict::check(_queryEnv.getProperties(), rankSetup.create_postinglist_when_non_strict());
+ _query.fetchPostings(search::queryeval::ExecuteInfo::create(is_search, hitRate, &_requestContext.getDoom(),
+ create_postinglist_when_non_strict));
if (is_search) {
_query.handle_global_filter(_requestContext.getDoom(), searchContext.getDocIdLimit(),
_attribute_blueprint_params.global_filter_lower_limit,
_attribute_blueprint_params.global_filter_upper_limit,
- thread_bundle, trace);
+ thread_bundle, trace, create_postinglist_when_non_strict);
}
_query.freeze();
trace.addEvent(5, "Prepare shared state for multi-threaded rank executors");
diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp
index f55ba77cec8..de0a4846615 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp
@@ -248,7 +248,8 @@ Query::fetchPostings(const ExecuteInfo & executeInfo)
void
Query::handle_global_filter(const vespalib::Doom & doom, uint32_t docid_limit,
double global_filter_lower_limit, double global_filter_upper_limit,
- vespalib::ThreadBundle &thread_bundle, search::engine::Trace& trace)
+ vespalib::ThreadBundle &thread_bundle, search::engine::Trace& trace,
+ bool create_postinglist_when_non_strict)
{
if (!handle_global_filter(*_blueprint, docid_limit, global_filter_lower_limit, global_filter_upper_limit, thread_bundle, &trace)) {
return;
@@ -258,7 +259,7 @@ Query::handle_global_filter(const vespalib::Doom & doom, uint32_t docid_limit,
_blueprint = Blueprint::optimize(std::move(_blueprint));
LOG(debug, "blueprint after handle_global_filter:\n%s\n", _blueprint->asString().c_str());
// strictness may change if optimized order changed:
- fetchPostings(ExecuteInfo::create(true, 1.0F, &doom));
+ fetchPostings(ExecuteInfo::create(true, 1.0F, &doom, create_postinglist_when_non_strict));
}
bool
diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.h b/searchcore/src/vespa/searchcore/proton/matching/query.h
index 6ea326834a5..3e2c7686066 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/query.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/query.h
@@ -106,7 +106,8 @@ public:
void handle_global_filter(const vespalib::Doom & doom, uint32_t docid_limit,
double global_filter_lower_limit, double global_filter_upper_limit,
- vespalib::ThreadBundle &thread_bundle, search::engine::Trace& trace);
+ vespalib::ThreadBundle &thread_bundle, search::engine::Trace& trace,
+ bool create_postinglist_when_non_strict);
/**
* Calculates and handles the global filter if needed by the blueprint tree.