See the Yonik's reply : http://search-lucene.com/m/tCmky1v94D92/

In short you need to use NamedList<Object> getResponse().

> I am currently trying to run a
> collapsable query using SolrJ using SolR 3.3.
> The problem is that when I run the query through the web
> interface, with
> this url:
> 
> http://localhost:8080/solr/select/?q=attr_content%3Alynx&sort=attr_location+desc&group=true&group.field=attr_directory
> 
> I am able to see the XML which is returned. The problem
> though, is that when
> I try to run the same query through SolrJ, using this
> code:
> 
>         SolrQuery queryString = new
> SolrQuery();
> 
>         for (String param :
> query.keySet())
> 
>         {
>             if
> (param.equals("fq"))
> 
>             {
>                
> queryString.addFilterQuery(query.get(param));
> 
>             }
>             else
>             {
>                
> queryString.setParam(param, query.get(param));
> 
>             }
>         }
> 
>        
> System.out.println(queryString.toString());
> 
>         QueryResponse response =
> server.query(queryString);
> //Exception takes place at this line
> 
>         SolrDocumentList docList =
> response.getResults();
> 
> Which constructs a URL like so:
> 
> q=attr_content%3Alynx&sort=attr_location+desc&group=true&group.field=attr_directory
> 
> This throws an exception:
> 
> Caused by: org.apache.solr.common.SolrException: parsing
> error at
> org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:145)
> at
> org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:106)
> at
> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:477)
> at
> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:244)
> at
> org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:89)
> ... 3 more Caused by: javax.xml.stream.XMLStreamException:
> ParseError at
> [row,col]:[3,30088] Message: error reading value:LST at
> org.apache.solr.client.solrj.impl.XMLResponseParser.readArray(XMLResponseParser.java:324)
> at
> org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:245)
> at
> org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:244)
> at
> org.apache.solr.client.solrj.impl.XMLResponseParser.readNamedList(XMLResponseParser.java:244)
> at
> org.apache.solr.client.solrj.impl.XMLResponseParser.processResponse(XMLResponseParser.java:130)
> 
> I have tried it with both Jetty and Tomcat, the error is
> the same for both.
> I have managed to get other queries to run (with both
> servers), so I presume
> that the problem lies with this particular type of query.
> 
> Any insight on this problem will be highly appreciated,
> 
> Thanks :)
>

Reply via email to