Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
The JSONResponseWriter class currently supports several styles of NamedList output format, documented on the wiki at http://wiki.apache.org/solr/SolJSON and in the code at https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java#L71-L76.
For example the 'arrmap' style:
NamedList("a"=1,"b"=2,null=3) => [{"a":1},{"b":2},3] NamedList("a"=1,"bar”=“foo",null=3.4f) => [{"a":1},{"bar”:”foo"},{3.4}]
This patch creates a new style ‘arrnvp’ which is an array of named value pairs. For example:
NamedList("a"=1,"b"=2,null=3) => [{"name":"a","int":1},{"name":"b","int":2},{"int":3}] NamedList("a"=1,"bar”=“foo",null=3.4f) => [{"name":"a","int":1},{"name":"b","str":"foo"},{"float":3.4}]
This style maintains the type information of the values, similar to the xml format:
<lst name=“someField”> <int name=“a”>1</int> <str name=“bar”>foo</str> <float>3.4</float> </lst>
Attachments
Attachments
Issue Links
- is related to
-
SOLR-10635 json "arrntv" format can sometime produce invalid json
- Open
-
SOLR-9538 Relocate {JSON,Smile}WriterTest and TestBinaryResponseWriter to org.apache.solr.response
- Resolved
-
SOLR-9551 Add constructor to JSONWriter which takes wrapperFunction and namedListStyle
- Resolved