# Faceted Search API

API for faceted search has several interfaces - simple, top level ones, adequate for most users, and advanced, more complicated ones, for the more advanced users.

We now describe the simpler interfaces. There are mainly 3 interfaces for faceted search:

1. {@link org.apache.lucene.facet.search.params.FacetRequest Facets Request} defines requirements:
   - which facets are required, e.g. depth
   - what is computed for each facet - e.g. count, score.
2. {@link org.apache.lucene.facet.search.FacetsAccumulator Facets Extractor} Controls how facets are extracted, with variations of:
   - default (partitioned, like all extractors).
   - sampled - inspects only a fraction of the documents.
3. {@link org.apache.lucene.facet.search.FacetResultsHandler Facet Results Handler } Controls how results are further processed and merged (also between partitions):
   - Top K.
   - Tree.
   - Tree with top K at each level
   - ...