you can also try

URL urlo = new URL(url);// ensure that the url has wt=javabin in that
NamedList<Object> namedList = new
JavaBinCodec().unmarshal(urlo.openConnection().getInputStream());
QueryResponse response = new QueryResponse(namedList, null);


On Mon, Feb 8, 2010 at 11:49 PM, Jason Rutherglen
<jason.rutherg...@gmail.com> wrote:
> Here's what I did to resolve this:
>
> XMLResponseParser parser = new XMLResponseParser();
> URL urlo = new URL(url);
> InputStreamReader isr = new
> InputStreamReader(urlo.openConnection().getInputStream());
> NamedList<Object> namedList = parser.processResponse(isr);
> QueryResponse response = new QueryResponse(namedList, null);
>
> On Mon, Feb 8, 2010 at 10:03 AM, Jason Rutherglen
> <jason.rutherg...@gmail.com> wrote:
>> So here's what happens if I pass in a URL with parameters, SolrJ chokes:
>>
>> Exception in thread "main" java.lang.RuntimeException: Invalid base
>> url for solrj.  The base URL must not contain parameters:
>> http://locahost:8080/solr/main/select?q=video&qt=dismax
>>        at 
>> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.<init>(CommonsHttpSolrServer.java:205)
>>        at 
>> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.<init>(CommonsHttpSolrServer.java:180)
>>        at 
>> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.<init>(CommonsHttpSolrServer.java:152)
>>        at org.apache.solr.util.QueryTime.main(QueryTime.java:20)
>>
>>
>> On Mon, Feb 8, 2010 at 9:32 AM, Jason Rutherglen
>> <jason.rutherg...@gmail.com> wrote:
>>> Sorry for the poorly worded title... For SOLR-1761 I want to pass in a
>>> URL and parse the query response... However it's non-obvious to me how
>>> to do this using the SolrJ API, hence asking the experts here. :)
>>>
>>
>



-- 
-----------------------------------------------------
Noble Paul | Systems Architect| AOL | http://aol.com

Reply via email to