You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by darul <da...@gmail.com> on 2011/10/11 18:34:03 UTC

Newbie question

If using CommonsHttpSolrServer query() method with parameter wt=json, when
retrieving QueryResponse, how to do to get JSON result output stream ?

I do not understand, I can get response.getResults() etc...but no way to
find just JSON output stream.

Thanks,

Jul

--
View this message in context: http://lucene.472066.n3.nabble.com/Newbie-question-tp3413106p3413106.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Newbie question

Posted by Chris Hostetter <ho...@fucit.org>.
: If using CommonsHttpSolrServer query() method with parameter wt=json, when
: retrieving QueryResponse, how to do to get JSON result output stream ?

when you are using the CommonsHttpSolrServer level of API, the client 
takes care of parsing the response (which is typically in an efficient 
binary representation) into the basic data structures.

if you just want the raw response (in json or xml, or whatever) as a java 
String, then it may not be the API you really want: just use a basic 
HttpClient.


Alternately: you could consider writing your own subclass of 
ResponseParser that just slurps the InputStream that CommonsHttpSolrServer 
fetches for you.


-Hoss