diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-03-04 13:23:41 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-03-04 13:23:41 +0100 |
commit | c58a1614763db71e81e3e2ee1dc4f68669ea213a (patch) | |
tree | 792bc8a6871fa81ffd9ed8746f0e9020ab14fb15 /config-model/src/test/derived | |
parent | 805b289fa69c72a5e857374ab38882442b17e480 (diff) |
Revert "Revert "'true' and 'false' literals in ranking expressions""
This reverts commit 95979285c20b384c3053d210c9e4e4661e13ecd5.
Diffstat (limited to 'config-model/src/test/derived')
-rw-r--r-- | config-model/src/test/derived/rankingexpression/macro.expression (renamed from config-model/src/test/derived/rankexpression/macro.expression) | 0 | ||||
-rw-r--r-- | config-model/src/test/derived/rankingexpression/overflow.expression (renamed from config-model/src/test/derived/rankexpression/overflow.expression) | 0 | ||||
-rw-r--r-- | config-model/src/test/derived/rankingexpression/rank-profiles.cfg (renamed from config-model/src/test/derived/rankexpression/rank-profiles.cfg) | 9 | ||||
-rw-r--r-- | config-model/src/test/derived/rankingexpression/rankexpression.expression (renamed from config-model/src/test/derived/rankexpression/rankexpression.expression) | 0 | ||||
-rw-r--r-- | config-model/src/test/derived/rankingexpression/rankexpression.sd (renamed from config-model/src/test/derived/rankexpression/rankexpression.sd) | 49 | ||||
-rw-r--r-- | config-model/src/test/derived/rankingexpression/summary.cfg (renamed from config-model/src/test/derived/rankexpression/summary.cfg) | 0 | ||||
-rw-r--r-- | config-model/src/test/derived/rankingexpression/summarymap.cfg (renamed from config-model/src/test/derived/rankexpression/summarymap.cfg) | 0 |
7 files changed, 41 insertions, 17 deletions
diff --git a/config-model/src/test/derived/rankexpression/macro.expression b/config-model/src/test/derived/rankingexpression/macro.expression index 054b025b2e7..054b025b2e7 100644 --- a/config-model/src/test/derived/rankexpression/macro.expression +++ b/config-model/src/test/derived/rankingexpression/macro.expression diff --git a/config-model/src/test/derived/rankexpression/overflow.expression b/config-model/src/test/derived/rankingexpression/overflow.expression index 4d3a6faeeb5..4d3a6faeeb5 100644 --- a/config-model/src/test/derived/rankexpression/overflow.expression +++ b/config-model/src/test/derived/rankingexpression/overflow.expression diff --git a/config-model/src/test/derived/rankexpression/rank-profiles.cfg b/config-model/src/test/derived/rankingexpression/rank-profiles.cfg index 6400870b0c4..6bad0434ac3 100644 --- a/config-model/src/test/derived/rankexpression/rank-profiles.cfg +++ b/config-model/src/test/derived/rankingexpression/rank-profiles.cfg @@ -363,3 +363,12 @@ rankprofile[].fef.property[].name "vespa.match.feature" rankprofile[].fef.property[].value "rankingExpression(mymul)" rankprofile[].fef.property[].name "vespa.type.attribute.t1" rankprofile[].fef.property[].value "tensor(m{},v[3])" +rankprofile[].name "withboolean" +rankprofile[].fef.property[].name "rankingExpression(mytrue).rankingScript" +rankprofile[].fef.property[].value "1.0" +rankprofile[].fef.property[].name "rankingExpression(myfalse).rankingScript" +rankprofile[].fef.property[].value "0.0" +rankprofile[].fef.property[].name "rankingExpression(mybooleanexpression).rankingScript" +rankprofile[].fef.property[].value "5.0" +rankprofile[].fef.property[].name "vespa.type.attribute.t1" +rankprofile[].fef.property[].value "tensor(m{},v[3])" diff --git a/config-model/src/test/derived/rankexpression/rankexpression.expression b/config-model/src/test/derived/rankingexpression/rankexpression.expression index d6cb73c829d..d6cb73c829d 100644 --- a/config-model/src/test/derived/rankexpression/rankexpression.expression +++ b/config-model/src/test/derived/rankingexpression/rankexpression.expression diff --git a/config-model/src/test/derived/rankexpression/rankexpression.sd b/config-model/src/test/derived/rankingexpression/rankexpression.sd index 73eb1cadadb..25d657eaf0b 100644 --- a/config-model/src/test/derived/rankexpression/rankexpression.sd +++ b/config-model/src/test/derived/rankingexpression/rankexpression.sd @@ -69,7 +69,8 @@ search rankexpression { rank-features: attribute(foo1).out attribute(bar1) rank-features { attribute(foo2).out attribute(bar2).out } rank-features { - attribute(foo3).out attribute(bar3).out } + attribute(foo3).out attribute(bar3).out + } rank-features { attribute(foo4).out attribute(bar4).out @@ -101,7 +102,8 @@ search rankexpression { summary-features: attribute(foo1).out attribute(bar1) summary-features { attribute(foo2).out attribute(bar2).out } summary-features { - attribute(foo3).out attribute(bar3).out } + attribute(foo3).out attribute(bar3).out + } summary-features { attribute(foo4).out attribute(bar4).out @@ -162,10 +164,10 @@ search rankexpression { second-phase { expression: fourtimessum(match,rankBoost) } - macro fourtimessum(var1, var2) { + function fourtimessum(var1, var2) { expression: 4*(var1+var2) } - macro myfeature() { + function myfeature() { expression { 70 * fieldMatch(title).completeness * pow(0 - fieldMatch(title).earliness, 2) + 30 * pow(0 - fieldMatch(description).earliness, 2) @@ -187,21 +189,21 @@ search rankexpression { second-phase { expression: fourtimessum(match,match) + mysummaryfeature + myfeature } - macro fourtimessum(var1, var2) { + function fourtimessum(var1, var2) { expression: 4*(var1+var2) } - macro myfeature() { + function myfeature() { expression { 70 * fieldMatch(title).completeness * pow(0 - fieldMatch(title).earliness, 2) + 30 * pow(0 - fieldMatch(description).earliness, 2) } } - macro mysummaryfeature() { + function mysummaryfeature() { expression { 70 * fieldMatch(title).completeness } } - macro mysummaryfeature2() { + function mysummaryfeature2() { expression { 71 * fieldMatch(title).completeness } @@ -213,7 +215,7 @@ search rankexpression { } rank-profile macros3 { - macro onlyusedinsummaryfeature() { + function onlyusedinsummaryfeature() { expression: 5 } summary-features { @@ -229,7 +231,7 @@ search rankexpression { } rank-profile macros-inherited inherits macros2 { - macro mysummaryfeature() { + function mysummaryfeature() { expression { 80 * fieldMatch(title).completeness } @@ -250,7 +252,7 @@ search rankexpression { } rank-profile macros-inherited3 inherits macros-inherited2 { - macro myfeature() { + function myfeature() { expression { 700 * fieldMatch(title).completeness } @@ -263,17 +265,17 @@ search rankexpression { } rank-profile macros-refering-macros { - macro m2() { + function m2() { expression: m1 * 67 } - macro m1() { + function m1() { expression { 700 * fieldMatch(title).completeness } } - macro m4() { + function m4() { expression: file:macro.expression } @@ -286,7 +288,7 @@ search rankexpression { } rank-profile macros-refering-macros-inherited inherits macros-refering-macros { - macro m3() { + function m3() { expression { if(isNan(attribute(nrtgmp))==1, 0.0, @@ -310,7 +312,7 @@ search rankexpression { } rank-profile macros-refering-macros-inherited-two-levels inherits macros-refering-macros-inherited { - macro m5() { + function m5() { expression { if(isNan(attribute(glmpfw))==1, m1, @@ -336,7 +338,8 @@ search rankexpression { match-features: attribute(foo1).out attribute(bar1) match-features { attribute(foo2).out attribute(bar2).out } match-features { - attribute(foo3).out attribute(bar3).out } + attribute(foo3).out attribute(bar3).out + } match-features { attribute(foo4) myplus @@ -346,4 +349,16 @@ search rankexpression { } } + rank-profile withboolean { + function mytrue() { + expression: true + } + function myfalse() { + expression: false + } + function mybooleanexpression() { + expression: true + if(false, 3.0, 4.0) + } + } + } diff --git a/config-model/src/test/derived/rankexpression/summary.cfg b/config-model/src/test/derived/rankingexpression/summary.cfg index aec076aa8fe..aec076aa8fe 100644 --- a/config-model/src/test/derived/rankexpression/summary.cfg +++ b/config-model/src/test/derived/rankingexpression/summary.cfg diff --git a/config-model/src/test/derived/rankexpression/summarymap.cfg b/config-model/src/test/derived/rankingexpression/summarymap.cfg index bd92b36548c..bd92b36548c 100644 --- a/config-model/src/test/derived/rankexpression/summarymap.cfg +++ b/config-model/src/test/derived/rankingexpression/summarymap.cfg |