}
taxonomyWriter.close();
iw.close();
DirectoryReader r = DirectoryReader.open(indexDir);
DirectoryTaxonomyReader taxo = new DirectoryTaxonomyReader(taxoDir);
FacetSearchParams sParams = new FacetSearchParams(fip,
new CountFacetRequest(new CategoryPath("a"), 10),
new SumScoreFacetRequest(new CategoryPath("b"), 10));
FacetsCollector fc = FacetsCollector.create(sParams, r, taxo);
TopScoreDocCollector topDocs = TopScoreDocCollector.create(10, false);
newSearcher(r).search(new MatchAllDocsQuery(), MultiCollector.wrap(fc, topDocs));
List<FacetResult> facetResults = fc.getFacetResults();
FacetResult fresA = facetResults.get(0);
assertEquals("unexpected count for " + fresA, r.maxDoc(), (int) fresA.getFacetResultNode().value);
FacetResult fresB = facetResults.get(1);
double expected = topDocs.topDocs().getMaxScore() * r.numDocs();
assertEquals("unexpected value for " + fresB, expected, fresB.getFacetResultNode().value, 1E-10);
IOUtils.close(taxo, taxoDir, r, indexDir);
}