/** 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()); } }
/** Sparse faceting: returns any dimension that had any * hits, topCount labels per dimension. */ public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, FacetsCollector hits) throws IOException { this.state = state; this.field = state.getField(); dv = state.getDocValues(); counts = new int[state.getSize()]; //System.out.println("field=" + field); count(hits.getMatchingDocs()); }