lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noble Paul നോബിള്‍ नोब्ळ् <noble.p...@corp.aol.com>
Subject Re: SolrJ and Json
Date Fri, 23 Oct 2009 12:06:11 GMT
CommonsHttpSolrServer will overwrite the wt param depending on the
responseParser set.There are  only two response parsers. javabin and
xml.

The qresponse.toString() actually is a String reperesentation of a
namedList object . it has nothing to do with JSON

On Fri, Oct 23, 2009 at 2:11 PM, SGE0 <stefangeelen@hotmail.com> wrote:
>
> Hi ,
>
> I have following problem:
> Using CommonsHttpSolrServer (javabin format) I do a query with wt=json and
> get following response (by using  qresponse = solr.query(params); and then
> qresponse.toString();
>
> {responseHeader={status=0,QTime=16,params={indent=on,start=0,q=mmm,qt=dismax,wt=[javabin,
> javabin],hl=on,rows=10,version=[1,
> 1]}},response={numFound=0,start=0,docs=[]},highlighting={}}
>
> Now this does not seems to be JSON format (or is it ) ?
>
> Should the equal sign not be a ':' and the values surrounded with double
> quotes ?
>
> The problem is that I want to pass the qresponse to a Javascript variable so
> the client javascript code can then inspect the JSON response and do
> whatever is needed.
>
> What I did was:
>
>  var str = "<%=qresponse.toString()%>";
>
> but I can't seem to correctly read the str variable as a JSON object and
> parse it (on the client side).
>
> Any ideas or code snippets to show the correct way ?
>
> Regards,
>
> St.
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/SolrJ-and-Json-tp26022705p26022705.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Mime
View raw message