/** Counts all facet dimensions across the provided hits. */ public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, FacetsCollector hits) throws IOException { this.state = state; this.field = state.getField(); dv = state.getDocValues(); counts = new int[state.getSize()]; if (hits == null) { // browse only countAll(); } else { count(hits.getMatchingDocs()); } }