diff options
24 files changed, 112 insertions, 26 deletions
diff --git a/README.md b/README.md index e37d5d3c68b..8eda989c6c6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ <!-- Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> -[![#Vespa](https://vespa.ai/assets/vespa-logo-color.png)](https://vespa.ai) +<picture> + <source media="(prefers-color-scheme: dark)" srcset="https://vespa.ai/assets/vespa-ai-logo-heather.svg"> + <source media="(prefers-color-scheme: light)" srcset="https://vespa.ai/assets/vespa-ai-logo-rock.svg"> + <img alt="#Vespa" width="200" src="https://vespa.ai/assets/vespa-ai-logo-rock.svg" style="margin-bottom: 25px;"> +</picture> +<br/><br/> Search, make inferences in, and organize vectors, tensors, text and structured data, at serving time and any scale. diff --git a/config-model-api/abi-spec.json b/config-model-api/abi-spec.json index 78b32d8af7b..81834c5e0cb 100644 --- a/config-model-api/abi-spec.json +++ b/config-model-api/abi-spec.json @@ -1287,7 +1287,8 @@ "public int searchHandlerThreadpool()", "public long mergingMaxMemoryUsagePerNode()", "public boolean usePerDocumentThrottledDeleteBucket()", - "public boolean alwaysMarkPhraseExpensive()" + "public boolean alwaysMarkPhraseExpensive()", + "public boolean createPostinglistWhenNonStrict()" ], "fields" : [ ] }, diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java index 6c9070c9d8a..cb394054510 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java @@ -116,6 +116,7 @@ public interface ModelContext { @ModelFeatureFlag(owners = {"vekterli"}) default long mergingMaxMemoryUsagePerNode() { return -1; } @ModelFeatureFlag(owners = {"vekterli"}) default boolean usePerDocumentThrottledDeleteBucket() { return false; } @ModelFeatureFlag(owners = {"baldersheim"}) default boolean alwaysMarkPhraseExpensive() { return false; } + @ModelFeatureFlag(owners = {"baldersheim"}) default boolean createPostinglistWhenNonStrict() { return true; } } /** Warning: As elsewhere in this package, do not make backwards incompatible changes that will break old config models! */ diff --git a/config-model/src/main/java/com/yahoo/schema/derived/RawRankProfile.java b/config-model/src/main/java/com/yahoo/schema/derived/RawRankProfile.java index 6a1ebb39ac8..411e754f3ef 100644 --- a/config-model/src/main/java/com/yahoo/schema/derived/RawRankProfile.java +++ b/config-model/src/main/java/com/yahoo/schema/derived/RawRankProfile.java @@ -171,6 +171,7 @@ public class RawRankProfile implements RankProfilesConfig.Producer { private final OptionalDouble targetHitsMaxAdjustmentFactor; private final double rankScoreDropLimit; private final boolean alwaysMarkPhraseExpensive; + private final boolean createPostinglistWhenNonStrict; /** * The rank type definitions used to derive settings for the native rank features @@ -213,6 +214,7 @@ public class RawRankProfile implements RankProfilesConfig.Producer { numSearchPartitions = compiled.getNumSearchPartitions(); termwiseLimit = compiled.getTermwiseLimit().orElse(deployProperties.featureFlags().defaultTermwiseLimit()); alwaysMarkPhraseExpensive = deployProperties.featureFlags().alwaysMarkPhraseExpensive(); + createPostinglistWhenNonStrict = deployProperties.featureFlags().createPostinglistWhenNonStrict(); postFilterThreshold = compiled.getPostFilterThreshold(); approximateThreshold = compiled.getApproximateThreshold(); targetHitsMaxAdjustmentFactor = compiled.getTargetHitsMaxAdjustmentFactor(); @@ -466,6 +468,9 @@ public class RawRankProfile implements RankProfilesConfig.Producer { if (alwaysMarkPhraseExpensive) { properties.add(new Pair<>("vespa.matching.always_mark_phrase_expensive", String.valueOf(alwaysMarkPhraseExpensive))); } + if ( ! createPostinglistWhenNonStrict) { + properties.add(new Pair<>("vespa.matching.create_postinglist_when_non_strict", String.valueOf(createPostinglistWhenNonStrict))); + } if (postFilterThreshold.isPresent()) { properties.add(new Pair<>("vespa.matching.global_filter.upper_limit", String.valueOf(postFilterThreshold.getAsDouble()))); } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java index 5ffd34c6557..104d19d8953 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java @@ -955,6 +955,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> { Element nodesElement = XML.getChild(containerElement, "nodes"); if (nodesElement == null) { cluster.addContainers(allocateWithoutNodesTag(cluster, context)); + cluster.setJvmGCOptions(buildJvmGCOptions(context, null)); } else { List<ApplicationContainer> nodes = createNodes(cluster, containerElement, nodesElement, context); diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java index e60052cb2a5..10adca12f91 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java @@ -187,6 +187,25 @@ public class JvmOptionsTest extends ContainerModelBuilderTestBase { "Invalid or misplaced JVM GC options in services.xml: -XX:+UseConcMarkSweepGC"); } + @Test + void verify_no_option_no_nodes_element_gives_value_from_feature_flag() throws IOException, SAXException { + String servicesXml = """ + <container version='1.0'> + <search/> + </container> + """; + ApplicationPackage applicationPackage = new MockApplicationPackage.Builder().withServices(servicesXml).build(); + // Need to create VespaModel to make deploy properties have effect + VespaModel model = new VespaModel(new NullConfigModelRegistry(), new DeployState.Builder() + .applicationPackage(applicationPackage) + .properties(new TestProperties().setJvmGCOptions("-XX:+UseParNewGC")) + .build()); + QrStartConfig.Builder qrStartBuilder = new QrStartConfig.Builder(); + model.getConfig(qrStartBuilder, "container/container.0"); + QrStartConfig qrStartConfig = new QrStartConfig(qrStartBuilder); + assertEquals("-XX:+UseParNewGC", qrStartConfig.jvm().gcopts()); + } + private void verifyLoggingOfJvmGcOptions(boolean isHosted, String override, String... invalidOptions) throws IOException, SAXException { verifyLogMessage(isHosted, "gc-options", override, invalidOptions); } diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java index 59266dfffaf..27c24c5d6ed 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ModelContextImpl.java @@ -202,6 +202,7 @@ public class ModelContextImpl implements ModelContext { private final int heapPercentage; private final String summaryDecodePolicy; private final boolean alwaysMarkPhraseExpensive; + private final boolean createPostinglistWhenNonStrict; private final int contentLayerMetadataFeatureLevel; private final boolean dynamicHeapSize; private final String unknownConfigDefinition; @@ -252,6 +253,7 @@ public class ModelContextImpl implements ModelContext { this.mergingMaxMemoryUsagePerNode = flagValue(source, appId, version, Flags.MERGING_MAX_MEMORY_USAGE_PER_NODE); this.usePerDocumentThrottledDeleteBucket = flagValue(source, appId, version, Flags.USE_PER_DOCUMENT_THROTTLED_DELETE_BUCKET); this.alwaysMarkPhraseExpensive = flagValue(source, appId, version, Flags.ALWAYS_MARK_PHRASE_EXPENSIVE); + this.createPostinglistWhenNonStrict = flagValue(source, appId, version, Flags.CREATE_POSTINGLIST_WHEN_NON_STRICT); } @Override public int heapSizePercentage() { return heapPercentage; } @@ -298,6 +300,7 @@ public class ModelContextImpl implements ModelContext { return defVal; } @Override public boolean alwaysMarkPhraseExpensive() { return alwaysMarkPhraseExpensive; } + @Override public boolean createPostinglistWhenNonStrict() { return createPostinglistWhenNonStrict; } @Override public int contentLayerMetadataFeatureLevel() { return contentLayerMetadataFeatureLevel; } @Override public boolean dynamicHeapSize() { return dynamicHeapSize; } @Override public String unknownConfigDefinition() { return unknownConfigDefinition; } diff --git a/dependency-versions/pom.xml b/dependency-versions/pom.xml index deb82e9e2c7..3ae42efb144 100644 --- a/dependency-versions/pom.xml +++ b/dependency-versions/pom.xml @@ -33,7 +33,7 @@ <!-- DO NOT UPGRADE THESE TO A NEW MAJOR VERSION WITHOUT CHECKING FOR BINARY COMPATIBILITY --> <aopalliance.vespa.version>1.0</aopalliance.vespa.version> - <commons-logging.vespa.version>1.2</commons-logging.vespa.version> <!-- This version is exported by jdisc via jcl-over-slf4j. --> + <commons-logging.vespa.version>1.3.0</commons-logging.vespa.version> <!-- This version is exported by jdisc via jcl-over-slf4j. --> <error-prone-annotations.vespa.version>2.23.0</error-prone-annotations.vespa.version> <guava.vespa.version>32.1.3-jre</guava.vespa.version> <guice.vespa.version>6.0.0</guice.vespa.version> diff --git a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java index 94cba73af39..5e395f04956 100644 --- a/flags/src/main/java/com/yahoo/vespa/flags/Flags.java +++ b/flags/src/main/java/com/yahoo/vespa/flags/Flags.java @@ -79,12 +79,15 @@ public class Flags { INSTANCE_ID); public static final UnboundStringFlag NESSUS_AGENT_GROUP = defineStringFlag( - "nessus-agent-group", "All", + "nessus-agent-group", ":legacy", List.of("hakonhall"), "2023-11-29", "2023-12-29", - "Either run nessusagent as before (All), or link against \"vespa-ci\"," + - " or disable the nessusagent (empty string \"\")", + "Link nessusagent to the given group, or run legacy task (\":legacy\"), or disable task (\"\").", "Takes effect after host admin restart", - (String value) -> value.equals("All") || value.equals("vespa-ci") || value.isEmpty(), + (String value) -> value.equals(":legacy") || // Run legacy task. Is a no-op outside YAHOO cloud. + value.equals(":stop") || // Stop / shut down Nessus if it is running + value.equals("All") || // Link to All group. + value.equals("vespa-ci") || // Link to vespa-ci group. + value.isEmpty(), // Skip task ARCHITECTURE, CLAVE); public static final UnboundIntFlag MAX_UNCOMMITTED_MEMORY = defineIntFlag( @@ -324,6 +327,13 @@ public class Flags { "Takes effect at redeployment", INSTANCE_ID); + public static final UnboundBooleanFlag CREATE_POSTINGLIST_WHEN_NON_STRICT = defineFeatureFlag( + "create-postinglist-when-non-strict", true, + List.of("baldersheim"), "2023-12-04", "2024-01-31", + "If true posting list can be created on the fly also for non-strict iterators", + "Takes effect at redeployment", + INSTANCE_ID); + public static final UnboundBooleanFlag WRITE_CONFIG_SERVER_SESSION_DATA_AS_ONE_BLOB = defineFeatureFlag( "write-config-server-session-data-as-blob", false, List.of("hmusum"), "2023-07-19", "2024-02-01", diff --git a/metrics/src/main/java/ai/vespa/metrics/GridLogMetrics.java b/metrics/src/main/java/ai/vespa/metrics/GridLogMetrics.java index 1286261d094..ff1bb05c579 100644 --- a/metrics/src/main/java/ai/vespa/metrics/GridLogMetrics.java +++ b/metrics/src/main/java/ai/vespa/metrics/GridLogMetrics.java @@ -13,7 +13,13 @@ public enum GridLogMetrics implements VespaMetrics { SIZE("gridlog.size", Unit.BYTE, "Size of sent entries"), PAYLOAD_TIME("gridlog.payload_time", Unit.SECOND, "Time spent building payload"), BUILD_TIME("gridlog.build_time", Unit.SECOND, "Time spent building entries"), - SEND_TIME("gridlog.send_time", Unit.SECOND, "Total time spend in worker thread"); + SEND_TIME("gridlog.send_time", Unit.SECOND, "Total time spend in worker thread"), + + KINESIS_LOGGER_RECEIVED("kinesislogger.received", Unit.ITEM, "Kinesis entries requested to send (after writing to disk)"), + KINESIS_LOGGER_SENT("kinesislogger.sent", Unit.ITEM, "Kinesis entries successfully sent"), + KINESIS_LOGGER_NOT_SENT("kinesislogger.not_sent", Unit.ITEM, "Kinesis entries not sent, due to some error"), + KINESIS_LOGGER_REJECTED("kinesislogger.rejected", Unit.ITEM, "Kinesis entries not sent, unable to write to disk"), + KINESIS_LOGGER_SEND_TIME("kinesislogger.send_time", Unit.SECOND, "Total time spent in kinesis worker thread"); private final String name; private final Unit unit; 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..ad1388f0407 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 = CreatePostingListWhenNonStrict::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. diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h index f5683546eea..eefb2ea77d5 100644 --- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h +++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h @@ -436,6 +436,8 @@ NumericPostingSearchContext<BaseSC, AttrT, DataT>::use_posting_lists_when_non_st // Based on this we see that LMC = 5 * PLMC. // The same relationship is found with the test case range_hits_ratio=[200]. + if ( ! info.create_postinglist_when_non_strict()) return false; + constexpr float lookup_match_constant = 5.0; constexpr float posting_list_merge_constant = 1.0; diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp index 9c986d0bc63..d503a955afc 100644 --- a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp +++ b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp @@ -461,6 +461,12 @@ bool AlwaysMarkPhraseExpensive::check(const Properties &props, bool fallback) { return lookupBool(props, NAME, fallback); } +const vespalib::string CreatePostingListWhenNonStrict::NAME("vespa.matching.create_postinglist_when_non_strict"); +const bool CreatePostingListWhenNonStrict::DEFAULT_VALUE(true); +bool CreatePostingListWhenNonStrict::check(const Properties &props, bool fallback) { + return lookupBool(props, NAME, fallback); +} + } // namespace matching namespace softtimeout { diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.h b/searchlib/src/vespa/searchlib/fef/indexproperties.h index 1921f52276f..7262e599235 100644 --- a/searchlib/src/vespa/searchlib/fef/indexproperties.h +++ b/searchlib/src/vespa/searchlib/fef/indexproperties.h @@ -347,6 +347,16 @@ namespace matching { static bool check(const Properties &props) { return check(props, DEFAULT_VALUE); } static bool check(const Properties &props, bool fallback); }; + + /** + * When enabled posting lists can be created on the fly even if iterator is not strict. + **/ + struct CreatePostingListWhenNonStrict { + static const vespalib::string NAME; + static const bool DEFAULT_VALUE; + static bool check(const Properties &props) { return check(props, DEFAULT_VALUE); } + static bool check(const Properties &props, bool fallback); + }; } namespace softtimeout { diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.cpp b/searchlib/src/vespa/searchlib/fef/ranksetup.cpp index d6b0b900516..ed74386b2fa 100644 --- a/searchlib/src/vespa/searchlib/fef/ranksetup.cpp +++ b/searchlib/src/vespa/searchlib/fef/ranksetup.cpp @@ -61,6 +61,7 @@ RankSetup::RankSetup(const BlueprintFactory &factory, const IIndexEnvironment &i _compileError(false), _degradationAscendingOrder(false), _always_mark_phrase_expensive(false), + _create_postinglist_when_non_strict(true), _diversityAttribute(), _diversityMinGroups(1), _diversityCutoffFactor(10.0), @@ -135,6 +136,7 @@ RankSetup::configure() _mutateOnSummary._operation = mutate::on_summary::Operation::lookup(_indexEnv.getProperties()); _mutateAllowQueryOverride = mutate::AllowQueryOverride::check(_indexEnv.getProperties()); _always_mark_phrase_expensive = matching::AlwaysMarkPhraseExpensive::check(_indexEnv.getProperties()); + _create_postinglist_when_non_strict = matching::CreatePostingListWhenNonStrict::check(_indexEnv.getProperties()); } void diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.h b/searchlib/src/vespa/searchlib/fef/ranksetup.h index d744b38cc6e..d560614ce39 100644 --- a/searchlib/src/vespa/searchlib/fef/ranksetup.h +++ b/searchlib/src/vespa/searchlib/fef/ranksetup.h @@ -70,6 +70,7 @@ private: bool _compileError; bool _degradationAscendingOrder; bool _always_mark_phrase_expensive; + bool _create_postinglist_when_non_strict; vespalib::string _diversityAttribute; uint32_t _diversityMinGroups; double _diversityCutoffFactor; @@ -222,6 +223,7 @@ public: return _degradationAscendingOrder; } bool always_mark_phrase_expensive() const noexcept { return _always_mark_phrase_expensive; } + bool create_postinglist_when_non_strict() const noexcept { return _create_postinglist_when_non_strict; } /** get number of hits to collect during graceful degradation in match phase */ uint32_t getDegradationMaxHits() const { return _degradationMaxHits; diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp index 639805e116e..6bc125226de 100644 --- a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp @@ -624,7 +624,7 @@ IntermediateBlueprint::fetchPostings(const ExecuteInfo &execInfo) double nextHitRate = execInfo.hitRate(); for (size_t i = 0; i < _children.size(); ++i) { Blueprint & child = *_children[i]; - child.fetchPostings(ExecuteInfo::create(execInfo.isStrict() && inheritStrict(i), nextHitRate, execInfo.getDoom())); + child.fetchPostings(ExecuteInfo::create(execInfo.isStrict() && inheritStrict(i), nextHitRate, execInfo)); nextHitRate = computeNextHitRate(child, nextHitRate); } } diff --git a/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp b/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp index 6a7ca84b72f..27366a9b924 100644 --- a/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp @@ -4,7 +4,7 @@ namespace search::queryeval { -const ExecuteInfo ExecuteInfo::TRUE(true, 1.0, nullptr); -const ExecuteInfo ExecuteInfo::FALSE(false, 1.0, nullptr); +const ExecuteInfo ExecuteInfo::TRUE(true, 1.0, nullptr, true); +const ExecuteInfo ExecuteInfo::FALSE(false, 1.0, nullptr, true); } diff --git a/searchlib/src/vespa/searchlib/queryeval/executeinfo.h b/searchlib/src/vespa/searchlib/queryeval/executeinfo.h index 362b0826f67..0095429e609 100644 --- a/searchlib/src/vespa/searchlib/queryeval/executeinfo.h +++ b/searchlib/src/vespa/searchlib/queryeval/executeinfo.h @@ -12,18 +12,25 @@ namespace search::queryeval { */ class ExecuteInfo { public: - ExecuteInfo() noexcept : ExecuteInfo(false, 1.0F, nullptr) { } + ExecuteInfo() noexcept : ExecuteInfo(false, 1.0F, nullptr, true) { } bool isStrict() const noexcept { return _strict; } + bool create_postinglist_when_non_strict() const noexcept { return _create_postinglist_when_non_strict; } float hitRate() const noexcept { return _hitRate; } bool soft_doom() const noexcept { return _doom && _doom->soft_doom(); } const vespalib::Doom * getDoom() const { return _doom; } static const ExecuteInfo TRUE; static const ExecuteInfo FALSE; static ExecuteInfo create(bool strict, const ExecuteInfo & org) noexcept { - return {strict, org._hitRate, org.getDoom()}; + return {strict, org._hitRate, org.getDoom(), org.create_postinglist_when_non_strict()}; + } + static ExecuteInfo create(bool strict, float hitRate, const ExecuteInfo & org) noexcept { + return {strict, hitRate, org.getDoom(), org.create_postinglist_when_non_strict()}; } static ExecuteInfo create(bool strict, float hitRate, const vespalib::Doom * doom) noexcept { - return {strict, hitRate, doom}; + return create(strict, hitRate, doom, true); + } + static ExecuteInfo create(bool strict, float hitRate, const vespalib::Doom * doom, bool postinglist_when_non_strict) noexcept { + return {strict, hitRate, doom, postinglist_when_non_strict}; } static ExecuteInfo createForTest(bool strict) noexcept { return createForTest(strict, 1.0F); @@ -32,14 +39,16 @@ public: return create(strict, hitRate, nullptr); } private: - ExecuteInfo(bool strict, float hitRate_in, const vespalib::Doom * doom) noexcept + ExecuteInfo(bool strict, float hitRate_in, const vespalib::Doom * doom, bool postinglist_when_non_strict) noexcept : _doom(doom), _hitRate(hitRate_in), - _strict(strict) + _strict(strict), + _create_postinglist_when_non_strict(postinglist_when_non_strict) { } const vespalib::Doom * _doom; float _hitRate; bool _strict; + bool _create_postinglist_when_non_strict; }; } diff --git a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp index 5c795679d48..c93cef47c27 100644 --- a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp +++ b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp @@ -63,7 +63,7 @@ SameElementBlueprint::fetchPostings(const ExecuteInfo &execInfo) double hit_rate = execInfo.hitRate() * _terms[0]->hit_ratio(); for (size_t i = 1; i < _terms.size(); ++i) { Blueprint & term = *_terms[i]; - term.fetchPostings(ExecuteInfo::create(false, hit_rate, execInfo.getDoom())); + term.fetchPostings(ExecuteInfo::create(false, hit_rate, execInfo)); hit_rate = hit_rate * term.hit_ratio(); } } |