bean1.setPopularity(2);
solrTemplate.saveBeans(Arrays.asList(bean1, bean2, bean3));
solrTemplate.commit();
StatsOptions statsOptions = new StatsOptions().addField("popularity").addField("price")
.setSelectiveCalcDistinct(true);
SimpleQuery statsQuery = new SimpleQuery(new SimpleStringCriteria("*:*"));
statsQuery.setStatsOptions(statsOptions);
StatsPage<ExampleSolrBean> statResultPage = solrTemplate.queryForStatsPage(statsQuery, ExampleSolrBean.class);