lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per Steffensen <st...@designware.dk>
Subject Re: Solrj question
Date Tue, 04 Dec 2012 15:24:23 GMT
Believe there are no setParser method on CloudSolrServer?

Have you tried this:
XMLWriter.writeResponse(<a java.io.Writer for your XML output>, <your 
SolrQueryRequest>, <your SolrQueryResponse>)
It will require you to include solr-core, since that is where XMLWriter 
lives.

But it is a little inefficient, if I understand you correctly. If you 
have a CloudSolrServer doing a request and asks for a response in e.g. 
XML format, then this CloudSolrServer will receive a XML response over 
the wire, parse it into a SolrQueryResponse object and then you will 
take that SolrQueryResponse and serialize it back to XML. It would be 
nicer if you just used whatever was received on the wire directly.

Regards, Per Steffensen

Erick Erickson skrev:
> haven't tried this personally, but try this:
> server.setParser(new XMLResponseParser());
>   
> Best
> Erick
>
>
> On Mon, Dec 3, 2012 at 10:24 AM, Steve Molloy <smolloy@opentext.com 
> <mailto:smolloy@opentext.com>> wrote:
>
>     I’ve been digging around a bit and could not find any
>     straight-forward way of getting back the XML response after
>     calling Solr using Solrj. The query method returns a QueryResponse
>     object, which is great in most cases. But our use case implies
>     pushing the response back to whatever format was requested, but
>     still use the CloudSolrServer client. This is very easy with the
>     javabin format, using the JavaBinCodec, but is there equivalent
>     utilities to marshal into other formats from a NamedList?
>     Otherwise, could the functionality be isolated for better reuse?
>
>      
>
>     Thanks,
>
>      
>
>     *Steve Molloy*
>     Content Analytics Lead  |  R&D
>
>     Phone:
>
>     	
>
>     (514) 908-5406 406 <tel:908-5406%20406>
>
>     Website:
>
>     	
>
>     www.opentext.com <http://www.opentext.com/>
>
>     http://www.opentext.com/2/emailsupport-logo-opentext-2010.gif
>     <http://www.opentext.com/2/email-signature-logo>
>
>     Nstein is now OpenText.
>     /Please update your address book with my new email address./
>
>     This email message is confidential, may be privileged, and is
>     intended for the exclusive use of the addressee. Any other person
>     is strictly prohibited from disclosing or reproducing it. If the
>     addressee cannot be reached or is unknown to you, please inform
>     the sender by return email and delete this email message and all
>     copies immediately.
>
>      
>
>


Mime
View raw message