diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/schema/derived/RawRankProfile.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/schema/derived/RawRankProfile.java | 18 |
1 files changed, 9 insertions, 9 deletions
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 87b79ddcdc3..388d2627224 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,7 +171,7 @@ public class RawRankProfile implements RankProfilesConfig.Producer { private final OptionalDouble approximateThreshold; private final OptionalDouble targetHitsMaxAdjustmentFactor; private final double rankScoreDropLimit; - private final boolean enableNestedMultivalueGrouping; + private final boolean alwaysMarkPhraseExpensive; /** * The rank type definitions used to derive settings for the native rank features @@ -186,6 +186,7 @@ public class RawRankProfile implements RankProfilesConfig.Producer { private RankingExpression secondPhaseRanking; private RankingExpression globalPhaseRanking; private final int globalPhaseRerankCount; + private final SerializationContext functionSerializationContext; /** * Creates a raw rank profile from the given rank profile @@ -212,7 +213,7 @@ public class RawRankProfile implements RankProfilesConfig.Producer { minHitsPerThread = compiled.getMinHitsPerThread(); numSearchPartitions = compiled.getNumSearchPartitions(); termwiseLimit = compiled.getTermwiseLimit().orElse(deployProperties.featureFlags().defaultTermwiseLimit()); - enableNestedMultivalueGrouping = deployProperties.featureFlags().enableNestedMultivalueGrouping(); + alwaysMarkPhraseExpensive = deployProperties.featureFlags().alwaysMarkPhraseExpensive(); postFilterThreshold = compiled.getPostFilterThreshold(); approximateThreshold = compiled.getApproximateThreshold(); targetHitsMaxAdjustmentFactor = compiled.getTargetHitsMaxAdjustmentFactor(); @@ -225,7 +226,7 @@ public class RawRankProfile implements RankProfilesConfig.Producer { List<ExpressionFunction> functionExpressions = functions.values().stream().map(RankProfile.RankingExpressionFunction::function).toList(); Map<String, String> functionProperties = new LinkedHashMap<>(); var typeContext = compiled.typeContext(queryProfiles); - SerializationContext functionSerializationContext = new SerializationContext(functionExpressions, Map.of(), typeContext); + this.functionSerializationContext = new SerializationContext(functionExpressions, Map.of(), typeContext); if (firstPhaseRanking != null) { functionProperties.putAll(firstPhaseRanking.getRankProperties(functionSerializationContext)); } @@ -265,8 +266,6 @@ public class RawRankProfile implements RankProfilesConfig.Producer { private void derivePropertiesAndFeaturesFromFunctions(Map<String, RankProfile.RankingExpressionFunction> functions, Map<String, String> functionProperties, SerializationContext functionContext) { - if (functions.isEmpty()) return; - replaceFunctionFeatures(summaryFeatures, functionContext); replaceFunctionFeatures(matchFeatures, functionContext); @@ -465,8 +464,8 @@ public class RawRankProfile implements RankProfilesConfig.Producer { if (termwiseLimit < 1.0) { properties.add(new Pair<>("vespa.matching.termwise_limit", termwiseLimit + "")); } - if (enableNestedMultivalueGrouping) { - properties.add(new Pair<>("vespa.temporary.enable_nested_multivalue_grouping", String.valueOf(enableNestedMultivalueGrouping))); + if (alwaysMarkPhraseExpensive) { + properties.add(new Pair<>("vespa.matching.always_mark_phrase_expensive", String.valueOf(alwaysMarkPhraseExpensive))); } if (postFilterThreshold.isPresent()) { properties.add(new Pair<>("vespa.matching.global_filter.upper_limit", String.valueOf(postFilterThreshold.getAsDouble()))); @@ -556,11 +555,12 @@ public class RawRankProfile implements RankProfilesConfig.Producer { if ("".equals(name)) name = phase; + String expressionAsString = expression.getRoot().toString(functionSerializationContext).toString(); if (expression.getRoot() instanceof ReferenceNode) { - properties.add(new Pair<>("vespa.rank." + phase, expression.getRoot().toString())); + properties.add(new Pair<>("vespa.rank." + phase, expressionAsString)); } else { properties.add(new Pair<>("vespa.rank." + phase, wrapInRankingExpression(name))); - properties.add(new Pair<>(RankingExpression.propertyName(name), expression.getRoot().toString())); + properties.add(new Pair<>(RankingExpression.propertyName(name), expressionAsString)); } return properties; } |