summaryrefslogtreecommitdiffstats
path: root/container-search/src
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-09-20 10:07:02 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-09-20 10:07:02 +0200
commit7bc1bddf8450d71e62ec11c05d55d3082ab8b1dc (patch)
tree780ca8a9889c944107305dc5120b939db73be365 /container-search/src
parent606e2851a1c1005a1d241e58dca5ca5637ad3f3e (diff)
Serialize int in SameItem
Diffstat (limited to 'container-search/src')
-rw-r--r--container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java b/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java
index f326903bff5..f680301f1fd 100644
--- a/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java
+++ b/container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java
@@ -90,6 +90,7 @@ import com.yahoo.prelude.query.Substring;
import com.yahoo.prelude.query.SubstringItem;
import com.yahoo.prelude.query.SuffixItem;
import com.yahoo.prelude.query.TaggableItem;
+import com.yahoo.prelude.query.TermItem;
import com.yahoo.prelude.query.ToolBox;
import com.yahoo.prelude.query.ToolBox.QueryVisitor;
import com.yahoo.prelude.query.UriItem;
@@ -645,6 +646,7 @@ public class VespaSerializer {
}
private static class SameElementSerializer extends Serializer {
+
@Override
void onExit(StringBuilder destination, Item item) { }
@@ -654,7 +656,6 @@ public class VespaSerializer {
}
static boolean serialize(StringBuilder destination, Item item, boolean includeField) {
-
SameElementItem sameElement = (SameElementItem) item;
if (includeField) {
@@ -669,10 +670,11 @@ public class VespaSerializer {
Item current = sameElement.getItem(i);
if (current instanceof WordItem) {
new WordSerializer().serialize(destination, current);
+ } else if (current instanceof IntItem) {
+ new NumberSerializer().serialize(destination, current);
} else {
- throw new IllegalArgumentException(
- "Serializing of " + current.getClass().getSimpleName()
- + " in same_element is not implemented, please report this as a bug.");
+ throw new IllegalArgumentException("Serializing of " + current.getClass().getSimpleName() +
+ " in same_element is not implemented, please report this as a bug.");
}
}
destination.append(')');