I have a solr query like this
q=categories:cat1 OR categories:cat2&stats=true&stats.field=count&stats.facet=block_num
Basically, I want to get the sum(count) group by block num.
This query works on a browser. But with solrj, I could not access the stats fields from Response obj. I can do a response.getFieldStatsInfo(). But it is not what I want. Here is how I construct the query
SolrQuery query = new SolrQuery(q);
query.add("stats", "true");
query.add("stats.field", "count");
query.add("stats.facet", "block_num");
With a debugger, I could see that the response has a private statsInfo object and it has the information I am looking for. But there is no api to access the object.
I would like to know if there is
- a better way to query a solr server other than solrj (curl? how do you parse the response?
- a better way to construct my query. maybe using group instead of stats?
- a way to access the hidden statsInfo object in the query response()? [it is so frustrated. I can see all the info I need in the private obj on my debugger!]
Thanks!