req.setFacetSpec("industry", fspec);
req.setFacetSpec("proposal_accepts", fspec);
req.setFacetSpec("num_endorsers", fspec);
req.setFacetSpec("group_id", fspec);
BoboIndexReader reader = BoboIndexReader.getInstance(IndexReader.open(idxDir));
BoboBrowser browser = new BoboBrowser(reader);
BrowseResult res = browser.browse(req);
Map<String,FacetAccessible> facetMap = res.getFacetMap();
Collection<FacetAccessible> facetCountCollectors = facetMap.values();
Iterator<FacetAccessible> iter = facetCountCollectors.iterator();
while (iter.hasNext())
{
FacetAccessible f = iter.next();
if (f instanceof FacetCountCollector)
{
System.out.println("====================================");
FacetCountCollector fc = (FacetCountCollector)f;
int[] dist = BigIntArray.toArray(fc.getCountDistribution());
if (dist!=null)
{
ChiSquaredFacetCountStatisticsGenerator gen = new ChiSquaredFacetCountStatisticsGenerator();
gen.setMinCount(0);
FacetCountStatistics stats = gen.generateStatistic(dist, 0);
System.out.println("stat for field "+fc.getName()+": "+stats);
System.out.println("Centered distribution score: " + (stats.getDistribution()-(double)(stats.getNumSamplesCollected()-1))/Math.sqrt((2.0*(double)(stats.getNumSamplesCollected()-1))));
System.out.println("........................");
List<BrowseFacet> facetList = fc.getFacets();
System.out.println(facetList);
System.out.println("........................");
}
System.out.println("====================================");
}
}
reader.close();
}