diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-06-16 19:05:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 19:05:53 +0200 |
commit | 635dd639aae6386ac8977ede9557210534934bd0 (patch) | |
tree | 3e4bcf063c4875dc56aa1ca24dabed32b5e6fe79 /container-search | |
parent | 1a79c78e274fb587634f48f4a131a3cbc97192ff (diff) | |
parent | d21f4042eb053fb63cc61747efe8a1953144fe28 (diff) |
Merge pull request #23128 from vespa-engine/bratseth/default-short-form-harder
Default to tensor short form more places
Diffstat (limited to 'container-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; |