faceted search
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 ((FastTaxonomyFacetCounts, TaxonomyFacetCounts) aggregate long or double values <xref:Lucene.Net.Facet.Taxonomy.TaxonomyFacetSumIntAssociations>, <xref:Lucene.Net.Facet.Taxonomy.TaxonomyFacetSumFloatAssociations>, TaxonomyFacetSumValueSource. Add FacetField or AssociationFacetField to 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 (<xref:Lucene.Net.Facet.Sortedset.SortedSetDocValuesFacetCounts>). Add <xref:Lucene.Net.Facet.Sortedset.SortedSetDocValuesFacetField> to your documents at index time to use sorted set facet counts. * Range faceting <xref:Lucene.Net.Facet.Range.LongRangeFacetCounts>, DoubleRangeFacetCounts compute counts for a dynamic numeric range from a provided <xref:Lucene.Net.Queries.Function.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 counts.
The various #search utility methods are useful for doing an "ordinary" search (sorting by score, or by a specified Sort) but also collecting into a FacetsCollector for subsequent faceting.