diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-06-16 12:23:31 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-06-16 12:23:31 +0200 |
commit | 6220353ea428b876a118f6e677acc7070a1bccc5 (patch) | |
tree | c4fdccfcd868c3426c46bb094863cf1612281719 /container-search/src/main/java/com/yahoo/search | |
parent | 5e04fc01305aa686576abf90e31743481fd7540c (diff) |
Default to tensor short form more places
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/properties/QueryProperties.java | 2 | ||||
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/properties/QueryProperties.java b/container-search/src/main/java/com/yahoo/search/query/properties/QueryProperties.java index f6e158cf04a..160a039fe2d 100644 --- a/container-search/src/main/java/com/yahoo/search/query/properties/QueryProperties.java +++ b/container-search/src/main/java/com/yahoo/search/query/properties/QueryProperties.java @@ -300,7 +300,7 @@ public class QueryProperties extends Properties { } else if (key.size() == 3 && key.get(1).equals(Presentation.FORMAT)) { if (key.last().equals(Presentation.TENSORS)) - query.getPresentation().setTensorShortForm(asString(value, "")); + query.getPresentation().setTensorShortForm(asString(value, "short")); else throwIllegalParameter(key.last(), Presentation.FORMAT); } diff --git a/container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java b/container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java index 58353cc5907..4f55b9946a8 100644 --- a/container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java +++ b/container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java @@ -124,13 +124,14 @@ public class JsonRenderer extends AsynchronousSectionedRenderer<Result> { private volatile JsonGenerator generator; private volatile FieldConsumer fieldConsumer; private volatile Deque<Integer> renderedChildren; + static class FieldConsumerSettings { volatile boolean debugRendering = false; volatile boolean jsonDeepMaps = true; volatile boolean jsonWsets = true; volatile boolean jsonMapsAll = true; volatile boolean jsonWsetsAll = false; - volatile boolean tensorShortForm = false; + volatile boolean tensorShortForm = true; boolean convertDeep() { return (jsonDeepMaps || jsonWsets); } void init() { this.debugRendering = false; @@ -138,7 +139,7 @@ public class JsonRenderer extends AsynchronousSectionedRenderer<Result> { this.jsonWsets = true; this.jsonMapsAll = true; this.jsonWsetsAll = true; - this.tensorShortForm = false; + this.tensorShortForm = true; } void getSettings(Query q) { if (q == null) { @@ -155,6 +156,7 @@ public class JsonRenderer extends AsynchronousSectionedRenderer<Result> { this.tensorShortForm = q.getPresentation().getTensorShortForm(); } } + private volatile FieldConsumerSettings fieldConsumerSettings; private volatile LongSupplier timeSource; private volatile OutputStream stream; |