summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-05-31 17:07:40 +0200
committerGitHub <noreply@github.com>2021-05-31 17:07:40 +0200
commitada8b5d4e433d5c714822fb094339da661423544 (patch)
tree4f5fb6c48ea8834c4d49cd226d8bb20c4dff8683
parent0327d6fe55c1b60c5f502eb3f75cb270e83cc8d1 (diff)
parentb041c3effea0dfd81633afa2c4ae49c139caf5a8 (diff)
Merge pull request #18042 from vespa-engine/balder/guard-deriving-behind-feature-flag
Guard deriving of file expression behind flag
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java
index 5602ba67373..1115a4ce405 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/RawRankProfile.java
@@ -187,7 +187,9 @@ public class RawRankProfile implements RankProfilesConfig.Producer {
Map<String, RankProfile.RankingExpressionFunction> functions = compiled.getFunctions();
List<ExpressionFunction> functionExpressions = functions.values().stream().map(f -> f.function()).collect(Collectors.toList());
Map<String, String> functionProperties = new LinkedHashMap<>();
- SerializationContext functionSerializationContext = new FunctionSerializationContext(unCompiledRankProfile, functionExpressions, functionProperties);
+ SerializationContext functionSerializationContext = useExternalExpressionFiles
+ ? new FunctionSerializationContext(unCompiledRankProfile, functionExpressions, functionProperties)
+ : new SerializationContext(functionExpressions);
if (firstPhaseRanking != null) {
functionProperties.putAll(firstPhaseRanking.getRankProperties(functionSerializationContext));
@@ -247,9 +249,7 @@ public class RawRankProfile implements RankProfilesConfig.Producer {
Map<String, String> functionProperties,
SerializationContext context) {
for (Map.Entry<String, RankProfile.RankingExpressionFunction> e : functions.entrySet()) {
- if (useExternalExpressionFiles && unCompiledRankProfile.getExpressionFile(e.getKey()) != null) {
- continue;
- }
+ if (useExternalExpressionFiles && unCompiledRankProfile.getExpressionFile(e.getKey()) != null) continue;
String propertyName = RankingExpression.propertyName(e.getKey());
if (context.serializedFunctions().containsKey(propertyName)) continue;