diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-04-12 15:30:24 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-04-12 15:30:24 +0200 |
commit | 5f714290d920238819aa55fecd820e006f9e5324 (patch) | |
tree | db121e1e906b6bb77b4dd56450a8081b9dcead1a /config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation | |
parent | 787fa05cebd66820136372164b7e1b2805f9f061 (diff) |
Add cased/uncased to match settings too.
Only allow btree uncase/uncased, and hash:cased/cased for now.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation')
2 files changed, 12 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/DictionaryOperation.java b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/DictionaryOperation.java index 70b0706df29..12f0509686a 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/DictionaryOperation.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/DictionaryOperation.java @@ -2,6 +2,7 @@ package com.yahoo.searchdefinition.fieldoperation; +import com.yahoo.searchdefinition.document.Case; import com.yahoo.searchdefinition.document.Dictionary; import com.yahoo.searchdefinition.document.SDField; @@ -28,10 +29,10 @@ public class DictionaryOperation implements FieldOperation { dictionary.updateType(Dictionary.Type.BTREE); break; case CASED: - dictionary.updateMatch(Dictionary.Match.CASED); + dictionary.updateMatch(Case.CASED); break; case UNCASED: - dictionary.updateMatch(Dictionary.Match.UNCASED); + dictionary.updateMatch(Case.UNCASED); break; default: throw new IllegalArgumentException("Unhandled operation " + operation); diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/MatchOperation.java b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/MatchOperation.java index 5bfd2c38586..eba56bf964a 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/MatchOperation.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/fieldoperation/MatchOperation.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.searchdefinition.fieldoperation; +import com.yahoo.searchdefinition.document.Case; import com.yahoo.searchdefinition.document.Matching; import com.yahoo.searchdefinition.document.SDField; @@ -10,6 +11,7 @@ import com.yahoo.searchdefinition.document.SDField; public class MatchOperation implements FieldOperation { private Matching.Type matchingType; + private Case casing; private Integer gramSize; private Integer maxLength; private Matching.Algorithm matchingAlgorithm; @@ -34,10 +36,17 @@ public class MatchOperation implements FieldOperation { this.exactMatchTerminator = exactMatchTerminator; } + public void setCase(Case casing) { + this.casing = casing; + } + public void apply(SDField field) { if (matchingType != null) { field.setMatchingType(matchingType); } + if (casing != null) { + field.setMatchingCase(casing); + } if (gramSize != null) { field.getMatching().setGramSize(gramSize); } |