summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorArne Juul <arnej@vespa.ai>2023-10-30 11:48:50 +0000
committerArne Juul <arnej@vespa.ai>2023-10-30 11:51:20 +0000
commitbcb353acc5fa5432eeca3f41c81d757fc2d30fe0 (patch)
tree1dbc79b695a3100bb0ed848bee2503d3dfc855ea /container-search
parentecf09e55410ba9b7b70e83da2a449ca0efac1cef (diff)
unit test with feature name
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/test/java/com/yahoo/search/ranking/GlobalPhaseSetupTest.java8
-rw-r--r--container-search/src/test/resources/config/medium/rank-profiles.cfg8
2 files changed, 13 insertions, 3 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/ranking/GlobalPhaseSetupTest.java b/container-search/src/test/java/com/yahoo/search/ranking/GlobalPhaseSetupTest.java
index dbe26c2ef94..4db73c5467e 100644
--- a/container-search/src/test/java/com/yahoo/search/ranking/GlobalPhaseSetupTest.java
+++ b/container-search/src/test/java/com/yahoo/search/ranking/GlobalPhaseSetupTest.java
@@ -32,7 +32,13 @@ public class GlobalPhaseSetupTest {
assertEquals(0, setup.normalizers.size());
assertEquals(9, setup.matchFeaturesToHide.size());
assertEquals(1, setup.globalPhaseEvalSpec.fromQuery().size());
- assertEquals(9, setup.globalPhaseEvalSpec.fromMF().size());
+ var wantMF = setup.globalPhaseEvalSpec.fromMF();
+ assertEquals(8, wantMF.size());
+ wantMF.sort((a, b) -> a.matchFeatureName().compareTo(b.matchFeatureName()));
+ assertEquals("attribute(t1)", wantMF.get(0).matchFeatureName());
+ assertEquals("attribute(t1)", wantMF.get(0).inputName());
+ assertEquals("myplus", wantMF.get(5).matchFeatureName());
+ assertEquals("rankingExpression(myplus)", wantMF.get(5).inputName());
}
@Test void queryFeaturesWithDefaults() {
diff --git a/container-search/src/test/resources/config/medium/rank-profiles.cfg b/container-search/src/test/resources/config/medium/rank-profiles.cfg
index 5a609f70cef..528946cb4cd 100644
--- a/container-search/src/test/resources/config/medium/rank-profiles.cfg
+++ b/container-search/src/test/resources/config/medium/rank-profiles.cfg
@@ -26,7 +26,7 @@ rankprofile[0].fef.property[11].value "firstPhase"
rankprofile[0].fef.property[12].name "vespa.match.feature"
rankprofile[0].fef.property[12].value "attribute(t1)"
rankprofile[0].fef.property[13].name "vespa.match.feature"
-rankprofile[0].fef.property[13].value "attribute(foo1)"
+rankprofile[0].fef.property[13].value "rankingExpression(myplus)"
rankprofile[0].fef.property[14].name "vespa.match.feature"
rankprofile[0].fef.property[14].value "fieldTermMatch(title,0).occurrences"
rankprofile[0].fef.property[15].name "vespa.match.feature"
@@ -44,7 +44,7 @@ rankprofile[0].fef.property[20].value "firstPhase"
rankprofile[0].fef.property[21].name "vespa.hidden.matchfeature"
rankprofile[0].fef.property[21].value "attribute(t1)"
rankprofile[0].fef.property[22].name "vespa.hidden.matchfeature"
-rankprofile[0].fef.property[22].value "attribute(foo1)"
+rankprofile[0].fef.property[22].value "rankingExpression(myplus)"
rankprofile[0].fef.property[23].name "vespa.hidden.matchfeature"
rankprofile[0].fef.property[23].value "fieldTermMatch(title,0).occurrences"
rankprofile[0].fef.property[24].name "vespa.hidden.matchfeature"
@@ -53,3 +53,7 @@ rankprofile[0].fef.property[25].name "vespa.globalphase.rerankcount"
rankprofile[0].fef.property[25].value "42"
rankprofile[0].fef.property[26].name "vespa.type.attribute.t1"
rankprofile[0].fef.property[26].value "tensor(m{},v[3])"
+rankprofile[0].fef.property[27].name "vespa.feature.rename"
+rankprofile[0].fef.property[27].value "rankingExpression(myplus)"
+rankprofile[0].fef.property[28].name "vespa.feature.rename"
+rankprofile[0].fef.property[28].value "myplus"