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 20:29:23 GMT
Steve Molloy skrev:
> I really hate duplicating code
I love you :-)
> Unless there's a way to get the original message before it's 
> unmarshaled into the QueryResponse, in which case I'd be more than 
> happy to use that as-is. J
Ha ha. Just had a short look at the code, and tried to hack it, but got 
tired, so I didnt complete or test it. But maybe this will help you 
(completely untested - dont even know if it will compile):

                    CloudSolrServer client = new 
CloudSolrServer(<zk-connect-string>, new LBHttpSolrServer(null) {
                        @Override
                        protected HttpSolrServer makeServer(String 
baseUrl) throws MalformedURLException {
                            return new HttpSolrServer(baseUrl, 
getHttpClient(), null) {
                                @Override
                                public NamedList<Object> request(final 
SolrRequest request) throws SolrServerException, IOException    {
                                    return request(request, null);
                                }
                            };
                        }
                    });
                    InputStream responseDirectlyFromWire = 
(InputStream)client.query(<query>).getResponse().get("stream");


Mime
View raw message