/** Counts all facet values for the provided {@link LongValuesSource}. This produces the same result as computing * facets on a {@link org.apache.lucene.search.MatchAllDocsQuery}, but is more efficient. */ public LongValueFacetCounts(String field, LongValuesSource valueSource, IndexReader reader) throws IOException { this.field = field; countAll(valueSource, field, reader); }
/** Counts all facet values for this reader. This produces the same result as computing * facets on a {@link org.apache.lucene.search.MatchAllDocsQuery}, but is more efficient. */ public LongValueFacetCounts(String field, IndexReader reader, boolean multiValued) throws IOException { this.field = field; if (multiValued) { countAllMultiValued(reader, field); } else { countAll(reader, field); } }