Hi, Thanks for the information. However, I still have one more problem. I am iterating over the values of the NamedList. I have 2 values, one being 'responseHeader' and the other one being 'grouped'. I would like to access some information stored within the grouped section, which has data structured like so:
grouped={attr_directory={matches=4,groups=[{groupValue=C:\Users\rvassallo\Desktop\Index,doclist={numFound=2,start=0,docs=[SolrDocument[{attr_meta=[Author, kcook, Last-Modified, 2011-03-02T14:14:18Z... With the 'get("group")' method I am only able to access the entire '{attr_directory={matches=4,g...' section. Is there some functionality which allows me to get other data? Something like this for instance: 'get("group.matches")' or maybe 'get(group.attr_directory.matches)' (which will yield the value of 4), or do I need to process the String that the 'get("...")' returns to get what I need? Thanks :) On Thu, Jul 14, 2011 at 12:52 PM, Ahmet Arslan <iori...@yahoo.com> wrote: > > 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 :) > > >