0

我想获取特定组中包含的行..这是我正在使用的代码..

String url = "http://localhost:8983/solr";
SolrServer server = new HttpSolrServer(url);
SolrQuery query = new SolrQuery();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");

query.setQuery("*:*");  
query.addFilterQuery("sessionStartTime:[2013-02-01T00:00:00Z TO 2013-03-30T24:00:00Z] ");

query.add("facet", "true");
query.add("facet.field","uniqueId");
query.add("facet.field", "sessionStartTime");

query.add("group", "true");
query.add("group.field","uniqueId");

query.add("group.field","sessionStartTime");
query.add("group.main","true");
query.add("group.ngroups","true");
query.add("group.facet","true");

query.setRows(9999);

QueryResponse rs=server.query(query);

System.out.println(rs.getGroupResponse());

我想要的是每组的计数(每组中的条目数)。但是 rs.getGroupResponse() 给了我空值...

帮助表示赞赏。

4

0 回答 0