diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-11-29 14:22:13 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-11-29 14:22:13 +0100 |
commit | 89f5b616f391124a8fbb6d2e9c4e8c4d32b91efa (patch) | |
tree | d5a12879a055a6ae3344b742b9dbdbbd1450f8f0 /config-model/src/main/java/com/yahoo/schema | |
parent | 3b5afd56981156cb608718925fcd55f9d7e38845 (diff) |
Limit yql in operator to string and integer fields.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/schema')
-rw-r--r-- | config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java b/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java index a1a358e96cd..7afa2b46693 100644 --- a/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java +++ b/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java @@ -52,6 +52,7 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer { private static final String CMD_PREDICATE = "predicate"; private static final String CMD_PREDICATE_BOUNDS = "predicate-bounds"; private static final String CMD_NUMERICAL = "numerical"; + private static final String CMD_INTEGER = "integer"; private static final String CMD_STRING = "string"; private static final String CMD_PHRASE_SEGMENTING = "phrase-segmenting"; private final Set<IndexCommand> commands = new java.util.LinkedHashSet<>(); @@ -172,9 +173,12 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer { if (isUriField(field)) { addUriIndexCommands(field); } - if (field.getDataType().getPrimitiveType() instanceof NumericDataType) { addIndexCommand(field, CMD_NUMERICAL); + if (isTypeOrNested(field, DataType.INT) || isTypeOrNested(field, DataType.LONG) || + isTypeOrNested(field, DataType.BYTE)) { + addIndexCommand(field, CMD_INTEGER); + } } if (isTypeOrNested(field, DataType.STRING)) { addIndexCommand(field, CMD_STRING); |