diff options
author | Geir Storli <geirst@yahooinc.com> | 2022-04-29 11:45:16 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2022-04-29 12:46:22 +0000 |
commit | 4541333bede340aa23572ec2b626fc0d14df7edd (patch) | |
tree | d1365751053fd9cc7296a41397a0ee74174b01bb /config-model/src/main/javacc/SDParser.jj | |
parent | 5b5f725ec9dd5ec81539e4d315e1d7adf054e0d1 (diff) |
Add support for approximate nearest neighbor threshold settings in rank profiles.
Diffstat (limited to 'config-model/src/main/javacc/SDParser.jj')
-rw-r--r-- | config-model/src/main/javacc/SDParser.jj | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj index 81631a70dbd..0ff9513885f 100644 --- a/config-model/src/main/javacc/SDParser.jj +++ b/config-model/src/main/javacc/SDParser.jj @@ -361,6 +361,8 @@ TOKEN : | < MINHITSPERTHREAD: "min-hits-per-thread" > | < NUMSEARCHPARTITIONS: "num-search-partitions" > | < TERMWISELIMIT: "termwise-limit" > +| < POSTFILTERTHRESHOLD: "post-filter-threshold" > +| < APPROXIMATETHRESHOLD: "approximate-threshold" > | < KEEPRANKCOUNT: "keep-rank-count" > | < RANKSCOREDROPLIMIT: "rank-score-drop-limit" > | < CONSTANTS: "constants" > @@ -1974,6 +1976,8 @@ void rankProfileItem(RankProfile profile) : { } | minHitsPerThread(profile) | numSearchPartitions(profile) | termwiseLimit(profile) + | postFilterThreshold(profile) + | approximateThreshold(profile) | rankFeatures(profile) | rankProperties(profile) | secondPhase(profile) @@ -2332,7 +2336,7 @@ void numSearchPartitions(RankProfile profile) : } /** - * This rule consumes a num-threads-per-search statement for a rank profile. + * This rule consumes a termwise-limit statement for a rank profile. * * @param profile the rank profile to modify */ @@ -2343,6 +2347,33 @@ void termwiseLimit(RankProfile profile) : { (<TERMWISELIMIT> <COLON> num = consumeFloat()) { profile.setTermwiseLimit(num); } } + +/** + * This rule consumes a post-filter-threshold statement for a rank profile. + * + * @param profile the rank profile to modify + */ +void postFilterThreshold(RankProfile profile) : +{ + double threshold; +} +{ + (<POSTFILTERTHRESHOLD> <COLON> threshold = consumeFloat()) { profile.setPostFilterThreshold(threshold); } +} + +/** + * This rule consumes an approximate-threshold statement for a rank profile. + * + * @param profile the rank profile to modify + */ +void approximateThreshold(RankProfile profile) : +{ + double threshold; +} +{ + (<APPROXIMATETHRESHOLD> <COLON> threshold = consumeFloat()) { profile.setApproximateThreshold(threshold); } +} + /** * This rule consumes a rank-properties block of a rank profile. There is a little trick within this rule to allow the * final rank property to skip the terminating newline token. |