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 Mark Fenbers <ma...@noaa.gov> on 2015/09/18 19:39:42 UTC
Headscratcher 2 of 2
Greetings!
I cannot seem to configure the spell-checker to return results in XML
instead of JSON. I tried programmatically, as in ...
params.set("wt", "xml");
solr.query(params);
... and I tried through the solrconfig.xml. My problem here is that it
is not exactly clear (because I've seen no example doing this) where the
spec
<str name="wt">xml</str>
is supposed to go (although I tried it in a number of places that made
intuitive sense to me). In which tag(s) does it go, exactly? Or do I
even have the spec syntax right?
Nothing I tried is working -- I get back JSON no matter what I try. Can
you offer specific advice?
Mark
Re: Headscratcher 2 of 2
Posted by Mark Fenbers <ma...@noaa.gov>.
OK, I understand now! To view the results before going much farther, I
simply did a "System.err.println(queryresponse);" which printed the
results in a JSON-like format. Instead, I need to use the methods of
the queryresponse object to view my output. Apparently, the
queryreponse.toString() is what is formatting in JSON... Doink!!
Thanks for the nudge!
Mark
On 9/18/2015 6:15 PM, Upayavira wrote:
> What URL are you posting to? Why do you want to use JSON or XML from
> SolrJ, which is best using javabin anyway?
>
> Get it right via a URL first, then try to port it over to SolrJ. Then,
> look in the Solr logs and you'll see the params that were passed over to
> Solr - maybe you'll see what's getting set wrong. Watch for more than
> one wt=, I bet Solr is always honouring the first.
>
> Upayavira
Re: Headscratcher 2 of 2
Posted by Upayavira <uv...@odoko.co.uk>.
What URL are you posting to? Why do you want to use JSON or XML from
SolrJ, which is best using javabin anyway?
Get it right via a URL first, then try to port it over to SolrJ. Then,
look in the Solr logs and you'll see the params that were passed over to
Solr - maybe you'll see what's getting set wrong. Watch for more than
one wt=, I bet Solr is always honouring the first.
Upayavira
On Fri, Sep 18, 2015, at 06:39 PM, Mark Fenbers wrote:
> Greetings!
>
> I cannot seem to configure the spell-checker to return results in XML
> instead of JSON. I tried programmatically, as in ...
>
> params.set("wt", "xml");
> solr.query(params);
>
> ... and I tried through the solrconfig.xml. My problem here is that it
> is not exactly clear (because I've seen no example doing this) where the
> spec
>
> <str name="wt">xml</str>
>
> is supposed to go (although I tried it in a number of places that made
> intuitive sense to me). In which tag(s) does it go, exactly? Or do I
> even have the spec syntax right?
>
> Nothing I tried is working -- I get back JSON no matter what I try. Can
> you offer specific advice?
>
> Mark
>