# Package org.apache.lucene.sandbox.facet

package org.apache.lucene.sandbox.facet
Sandbox faceting - Collectors that compute facets.

See `org.apache.lucene.sandbox.facet.utils` for simple API for most common use cases.

Lower level API is based on following concepts:

- Facet Ordinals/Ids: Each doc may have different facets and therefore, different facet ordinals. For example a book can have Author, Publish Date, Page Count etc. as facets. The specific value for each of these Facets for a book can be mapped to an ordinal. Facet ordinals may be common across different book documents.
- Facet Cutter: Can interpret Facets of a specific type for a doc type and output all the Facet Ordinals for the type for the doc.
- Facet Recorders: record data per ordinal. Some recorders may compute aggregations and record per ordinal data aggregated across an index.

See SandboxFacetsExample for examples.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- Related Packages
  Package
  Description
  org.apache.lucene.sandbox.facet.cutters
  Sandbox faceting: facet cutters, see `FacetCutter` for details.
  org.apache.lucene.sandbox.facet.iterators
  Sandbox faceting: facet ordinals.
  org.apache.lucene.sandbox.facet.labels
  Sandbox faceting: facet labels, see `OrdToLabel` for details.
  org.apache.lucene.sandbox.facet.recorders
  Sandbox faceting: classes that can record per ordinal data E.g.
  org.apache.lucene.sandbox.facet.utils
  Sandbox faceting: utility classes to make it easier to use the new API for standard use cases.
- Classes
  Class
  Description
  FacetFieldCollector
  `Collector` that brings together `FacetCutter` and `FacetRecorder` to compute facets during collection phase.
  FacetFieldCollectorManager<V extends FacetRecorder>
  Collector manager for `FacetFieldCollector`.