diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-06-08 22:48:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 22:48:46 +0200 |
commit | 583332f6acf5ac91c3cf3e8de23980c2818b5284 (patch) | |
tree | 3dff4a0456b3672f7b63de0fefb5c5beaa81d3b5 /container-search | |
parent | f954bda9c7773bb28f6005b15be2b512b83bc33e (diff) | |
parent | 61d512485d2251a9937b2a5aa1b2327228495077 (diff) |
Merge pull request #22996 from vespa-engine/lesters/short-tensor-format-as-default
Lesters/short tensor format as default MERGEOK
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/Presentation.java | 4 | ||||
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/rendering/JsonRendererTestCase.java | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/Presentation.java b/container-search/src/main/java/com/yahoo/search/query/Presentation.java index 31641b5c2f0..afa87eb4a06 100644 --- a/container-search/src/main/java/com/yahoo/search/query/Presentation.java +++ b/container-search/src/main/java/com/yahoo/search/query/Presentation.java @@ -75,7 +75,7 @@ public class Presentation implements Cloneable { private boolean timing = false; /** Whether to renders tensors in short form */ - private boolean tensorShortForm = false; + private boolean tensorShortForm = true; /** Set of explicitly requested summary fields, instead of summary classes */ private Set<String> summaryFields = LazySet.newHashSet(); @@ -180,7 +180,7 @@ public class Presentation implements Cloneable { * Returns whether tensors should use short form in JSON and textual representations, see * <a href="https://docs.vespa.ai/en/reference/document-json-format.html#tensor">https://docs.vespa.ai/en/reference/document-json-format.html#tensor</a> * and <a href="https://docs.vespa.ai/en/reference/tensor.html#tensor-literal-form">https://docs.vespa.ai/en/reference/tensor.html#tensor-literal-form</a>. - * Default is false. + * Default is true. */ public boolean getTensorShortForm() { return tensorShortForm; } diff --git a/container-search/src/test/java/com/yahoo/search/rendering/JsonRendererTestCase.java b/container-search/src/test/java/com/yahoo/search/rendering/JsonRendererTestCase.java index 118dcee9598..570b1d006de 100644 --- a/container-search/src/test/java/com/yahoo/search/rendering/JsonRendererTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/rendering/JsonRendererTestCase.java @@ -209,14 +209,14 @@ public class JsonRendererTestCase { + " \"object\": \"thingie\"," + " \"string\": \"stuff\"," + " \"predicate\": \"a in [b]\"," - + " \"tensor1\": { \"cells\": [ { \"address\": {\"x\": \"a\"}, \"value\":2.0 } ] }," + + " \"tensor1\": { \"type\": \"tensor(x{})\", \"cells\": { \"a\":2.0 } }," + " \"tensor2\": { \"cells\": [] }," - + " \"tensor3\": { \"cells\": [ { \"address\": {\"x\": \"a\", \"y\": \"0\"}, \"value\":2.0 }, { \"address\": {\"x\": \"a\", \"y\": \"1\"}, \"value\":-1.0 } ] }," + + " \"tensor3\": { \"type\": \"tensor(x{},y{})\", \"cells\": [ { \"address\": {\"x\": \"a\", \"y\": \"0\"}, \"value\":2.0 }, { \"address\": {\"x\": \"a\", \"y\": \"1\"}, \"value\":-1.0 } ] }," + " \"summaryfeatures\": {" + " \"scalar1\":1.5," + " \"scalar2\":2.5," - + " \"tensor1\":{\"type\":\"tensor(x[3])\",\"cells\":[{\"address\":{\"x\":\"0\"},\"value\":1.5},{\"address\":{\"x\":\"1\"},\"value\":2.0},{\"address\":{\"x\":\"2\"},\"value\":2.5}]}," - + " \"tensor2\":{\"type\":\"tensor()\",\"cells\":[{\"address\":{},\"value\":0.5}]}" + + " \"tensor1\":{\"type\":\"tensor(x[3])\", \"values\":[1.5, 2.0, 2.5] }," + + " \"tensor2\":{\"type\":\"tensor()\", \"values\":[0.5] }" + " }," + " \"data\": \"Data \\\\xc3\\\\xa6 \\\\xc3\\\\xa5\"" + " }," |