summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorArne Juul <arnej@yahooinc.com>2023-02-07 14:41:23 +0000
committerArne Juul <arnej@yahooinc.com>2023-02-07 14:41:23 +0000
commit38b9963d438e0df02fabe2ba6ae2d98062859cc6 (patch)
tree1a1581d1a1a1dad4c4970920b020042f658b547e /config-model
parent48465f0011cf25f01524a3238678afa9fdf61857 (diff)
add inputs as match features
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/schema/RankProfile.java5
-rw-r--r--config-model/src/test/derived/rankingexpression/rank-profiles.cfg10
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"