}
/** compute facets with certain facet requests and docs */
private List<FacetResult> findFacets(boolean withComplement) throws IOException {
FacetSearchParams fsp = new FacetSearchParams(fip, new CountFacetRequest(new CategoryPath("root","a"), 10));
StandardFacetsAccumulator sfa = new StandardFacetsAccumulator(fsp, indexReader, taxoReader);
sfa.setComplementThreshold(withComplement ? StandardFacetsAccumulator.FORCE_COMPLEMENT : StandardFacetsAccumulator.DISABLE_COMPLEMENT);
FacetsCollector fc = FacetsCollector.create(sfa);
searcher.search(new MatchAllDocsQuery(), fc);
List<FacetResult> res = fc.getFacetResults();
// Results are ready, printing them...
int i = 0;
if (VERBOSE) {
for (FacetResult facetResult : res) {
System.out.println("Res "+(i++)+": "+facetResult);
}
}
assertEquals(withComplement, sfa.isUsingComplements());
return res;
}