summaryrefslogtreecommitdiffstats
path: root/config-model/src
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2020-09-29 10:44:31 +0200
committerJon Bratseth <bratseth@gmail.com>2020-09-29 10:44:31 +0200
commit7cdf12a8a87f89573642ffbcba256bf546c4cee6 (patch)
tree65e80ca74fa668ba3e7355571e7c45d205470d75 /config-model/src
parent628a9a9dd57d9eadd3ad786c5cde40ccfec1ba63 (diff)
Support 'model' instead of 'rank-profile'
Diffstat (limited to 'config-model/src')
-rw-r--r--config-model/src/main/javacc/SDParser.jj4
-rw-r--r--config-model/src/test/derived/rankprofiles/rankprofiles.sd18
-rw-r--r--config-model/src/test/examples/desktop.sd14
3 files changed, 15 insertions, 21 deletions
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj
index bf752b39fa8..3bbcf7979f3 100644
--- a/config-model/src/main/javacc/SDParser.jj
+++ b/config-model/src/main/javacc/SDParser.jj
@@ -233,6 +233,7 @@ TOKEN :
| < SUFFIX: "suffix" >
| < CONSTANT: "constant">
| < ONNXMODEL: "onnx-model">
+| < MODEL: "model" >
| < RANKPROFILE: "rank-profile" >
| < RANKDEGRADATIONFREQ: "rank-degradation-frequency" >
| < RANKDEGRADATION: "rank-degradation" >
@@ -1976,7 +1977,7 @@ void rankProfile(Search search) :
RankProfile profile;
}
{
- ( <RANKPROFILE> name = identifierWithDash()
+ ( ( <MODEL> | <RANKPROFILE> ) name = identifierWithDash()
{
if (documentsOnly) {
profile = new DocumentsOnlyRankProfile(name, search, rankProfileRegistry);
@@ -2676,6 +2677,7 @@ String identifier() : { }
| <QUATERNARY>
| <QUERYCOMMAND>
| <RANK>
+ | <MODEL>
| <RANKPROFILE>
| <RANKPROPERTIES>
| <RANKSCOREDROPLIMIT>
diff --git a/config-model/src/test/derived/rankprofiles/rankprofiles.sd b/config-model/src/test/derived/rankprofiles/rankprofiles.sd
index abafee91533..6c3720df589 100644
--- a/config-model/src/test/derived/rankprofiles/rankprofiles.sd
+++ b/config-model/src/test/derived/rankprofiles/rankprofiles.sd
@@ -19,21 +19,21 @@ search rankprofiles {
}
- rank-profile default {
+ model default {
}
- rank-profile other1 inherits default {
+ model other1 inherits default {
rank field1: filter
rank none: filter
}
- rank-profile other2 inherits other1 {
+ model other2 inherits other1 {
}
- rank-profile other3 {
+ model other3 {
}
- rank-profile four {
+ model four {
match-phase {
attribute: field2
order: ascending
@@ -41,7 +41,7 @@ search rankprofiles {
}
}
- rank-profile five {
+ model five {
match-phase {
attribute: field2
order: descending
@@ -49,14 +49,14 @@ search rankprofiles {
}
}
- rank-profile six {
+ model six {
match-phase {
attribute: field3
max-hits: 666
}
}
- rank-profile seven {
+ model seven {
match-phase {
attribute: field3
max-hits:800
@@ -65,7 +65,7 @@ search rankprofiles {
}
}
- rank-profile eight inherits seven {
+ model eight inherits seven {
}
diff --git a/config-model/src/test/examples/desktop.sd b/config-model/src/test/examples/desktop.sd
index 82741dbe53f..8d263ca9ac4 100644
--- a/config-model/src/test/examples/desktop.sd
+++ b/config-model/src/test/examples/desktop.sd
@@ -82,25 +82,17 @@ search desktop {
default: true
}
- # Optionally specify a desire to use a shared dictionary ("catalogs")
- shared-dictionary: normal, title, manufacturer
-
- # Optionally set rank values for all indices
- # Default is the name of the default one
- # Rank settings from individual fields can be selectively overridden
- rankprofile default {
- firstocc-boost text: 200
+ model default {
}
# Another rank profile
- rankprofile predefinedorder {
+ model predefinedorder {
dynamicranking: off
attribute: someorder
}
# Some experimental ranking changes
- rankprofile experimental inherits default {
- firstocc-boost text: 300
+ model experimental inherits default {
}
}