This module provides multiple methods for computing facet counts and value aggregations:
- Taxonomy-based methods rely on a separate taxonomy index to
map hierarchical facet paths to global int ordinals for fast
counting at search time; these methods can compute counts
TaxonomyFacetCounts) aggregate long or double values
AssociationFacetFieldto your documents at index time to use taxonomy-based methods.
- Sorted-set doc values method does not require a separate
taxonomy index, and computes counts based on sorted set doc
values fields (
SortedSetDocValuesFacetFieldto your documents at index time to use sorted set facet counts.
- Range faceting
DoubleRangeFacetCountscompute counts for a dynamic numeric range from a provided
ValueSource(previously indexed numeric field, or a dynamic expression such as distance).
At search time you first run your search, but pass a
FacetsCollector to gather all hits (and optionally, scores for each
hit). Then, instantiate whichever facet methods you'd like to use
to compute aggregates. Finally, all methods implement a common
Facets base API that you use to obtain specific facet
FacetsCollector.search(org.apache.lucene.search.IndexSearcher, org.apache.lucene.search.Query, int, org.apache.lucene.search.Collector) utility methods are
useful for doing an "ordinary" search (sorting by score, or by a
specified Sort) but also collecting into a
Class Summary Class Description DrillDownQueryA
Queryfor drill-down over facet categories.
DrillSidewaysComputes drill down and sideways counts for the provided
DrillSideways.DrillSidewaysResult FacetFieldAdd an instance of this to your
Documentfor every facet label.
FacetResultCounts or aggregates for a single dimension. FacetsCommon base class for all facets implementations. FacetsCollectorCollects hits for subsequent faceting. FacetsCollector.MatchingDocsHolds the documents that were matched in the
FacetsConfigRecords per-dimension configuration. FacetsConfig.DimConfigHolds the configuration for one dimension LabelAndValueSingle label and its value, usually contained in a
MultiFacetsMaps specified dims to provided Facets impls; else, uses the default Facets impl. TopOrdAndFloatQueueKeeps highest results, first by largest float value, then tie break by smallest ord. TopOrdAndFloatQueue.OrdAndValueHolds a single entry. TopOrdAndIntQueueKeeps highest results, first by largest int value, then tie break by smallest ord. TopOrdAndIntQueue.OrdAndValueHolds a single entry.