diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-11-17 16:08:04 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-11-17 16:08:04 +0100 |
commit | b8205be37a08d3f6bc499a8252d410394555e1bb (patch) | |
tree | 31b6f4b8da4c080e342a3b74af10d719c4d300a4 /container-search/src/main/java/com/yahoo/prelude/query/Item.java | |
parent | b0ff93e170cdd38f1bc1b38b756a428c4e0726ca (diff) |
Add InItem to com.yahoo.prelude.query.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/query/Item.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/query/Item.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/query/Item.java b/container-search/src/main/java/com/yahoo/prelude/query/Item.java index e38579be2df..578adaaeaf9 100644 --- a/container-search/src/main/java/com/yahoo/prelude/query/Item.java +++ b/container-search/src/main/java/com/yahoo/prelude/query/Item.java @@ -56,7 +56,9 @@ public abstract class Item implements Cloneable { GEO_LOCATION_TERM(27), TRUE(28), FALSE(29), - FUZZY(30); + FUZZY(30), + STRING_IN(31), + NUMERIC_IN(32); public final int code; @@ -241,8 +243,9 @@ public abstract class Item implements Cloneable { byte FEAT_UNIQUEID = 0b01000000; byte FEAT_FLAGS = -0b10000000; - byte type = (byte) (getCode() & CODE_MASK); - if (type != getCode()) + int code = getCode(); + byte type = code >= CODE_MASK ? CODE_MASK : (byte) code; + if (code >= 0x80 + CODE_MASK) throw new IllegalStateException("must increase number of bytes in serialization format for queries"); if (weight != DEFAULT_WEIGHT) { @@ -257,6 +260,9 @@ public abstract class Item implements Cloneable { } buffer.put(type); + if (code >= CODE_MASK) { + buffer.put((byte) (code - CODE_MASK)); + } if ((type & FEAT_WEIGHT) != 0) { IntegerCompressor.putCompressedNumber(weight, buffer); } |