diff options
-rw-r--r-- | config-model/src/main/java/com/yahoo/schema/RankProfile.java | 5 | ||||
-rw-r--r-- | config-model/src/test/derived/rankingexpression/rank-profiles.cfg | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/RankProfile.java b/config-model/src/main/java/com/yahoo/schema/RankProfile.java index 6d5202164dc..e413ac2a90e 100644 --- a/config-model/src/main/java/com/yahoo/schema/RankProfile.java +++ b/config-model/src/main/java/com/yahoo/schema/RankProfile.java @@ -1020,6 +1020,11 @@ public class RankProfile implements Cloneable { recorder.transform(globalPhaseRanking.function().getBody(), context); for (String input : needInputs) { System.err.println("need input => " + input); + try { + addMatchFeatures(new FeatureList(input)); + } catch (com.yahoo.searchlib.rankingexpression.parser.ParseException e) { + throw new IllegalArgumentException("invalid input in global-phase expression: "+input); + } } } } diff --git a/config-model/src/test/derived/rankingexpression/rank-profiles.cfg b/config-model/src/test/derived/rankingexpression/rank-profiles.cfg index 6ff063c785c..ea8bc5f77e6 100644 --- a/config-model/src/test/derived/rankingexpression/rank-profiles.cfg +++ b/config-model/src/test/derived/rankingexpression/rank-profiles.cfg @@ -409,6 +409,16 @@ rankprofile[].fef.property[].name "vespa.rank.globalphase" rankprofile[].fef.property[].value "rankingExpression(globalphase)" rankprofile[].fef.property[].name "rankingExpression(globalphase).rankingScript" rankprofile[].fef.property[].value "rankingExpression(myplus) + reduce(rankingExpression(mymul), sum) + firstPhase" +rankprofile[].fef.property[].name "vespa.match.feature" +rankprofile[].fef.property[].value "query(fromq)" +rankprofile[].fef.property[].name "vespa.match.feature" +rankprofile[].fef.property[].value "firstPhase" +rankprofile[].fef.property[].name "vespa.match.feature" +rankprofile[].fef.property[].value "attribute(t1)" +rankprofile[].fef.property[].name "vespa.match.feature" +rankprofile[].fef.property[].value "attribute(foo1)" +rankprofile[].fef.property[].name "vespa.match.feature" +rankprofile[].fef.property[].value "attribute(foo2)" rankprofile[].fef.property[].name "vespa.globalphase.rerankcount" rankprofile[].fef.property[].value "42" rankprofile[].fef.property[].name "vespa.type.attribute.t1" |