HoustonPutman opened a new pull request, #1863:
URL: https://github.com/apache/solr/pull/1863

   https://issues.apache.org/jira/browse/SOLR-16933
   
   So the initial issue here is that the SolrDocumentList serialization used to 
only be really handled by the `SolrRequestWriter` (solr core only), and if you 
tried to use a general JSON serializer (`JSONWriter`), it would try to 
serialize the `SolrDocumentList` as an ArrayList of SolrDocuments, because it 
extends `ArrayList<SolrDocument>`. This meant that the `numFound`, 
`numFoundExact`, `start`, etc. fields were lost.
   
   Two solutions here:
   
   1. `SolrDocumentList` now extends `MapWriter`, so that it will serialize 
correctly even when used with a "dumb" serializer.
   2. The CLI tools that just print output from the APIs they call (`ApiTool`, 
`CreateTool`, `DeleteTool`), should use the `NoOpResponseParser("json")`, and 
just plainly echo the output of the API, without de-serializing and 
re-serializing.
   
   In the end # 2 is what actually fixes this, but # 1 is a good thing to 
include so that in the future people don't hit snags trying to serialize a Solr 
Query response with `JSONWriter`.
   
   (The indentation of JSONWriter with the SolrDocumentList is not ideal, but 
it works. And it doesn't really matter as we aren't reserializing anymore.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to