Facets Stage

The Facets query-pipeline stage (previously called the Facet stage) is used to add a Solr Field Facet query to the search query pipeline. A Field facet query computes the top values for a field and returns the list of those values along with a count of the subset of documents in the search results which match that term. Field faceting works best over fields which contain a single label or set of labels from a finite, controlled lexicon such as product category. Facet field parameters can be tuned for performance, see: Facet Field Configuration.

It’s possible to specify more than one field facets. For each field facet you must specify the field name plus the following additional parameters:

  • Limit – the maximum number of terms to be returned. Default 100.

  • Offset – the number of top facet values to skip in the response. Default 0.

  • Sort - the order in which to list facet values: count ordering is by documents per term, descending, and index ordering is sorted on term values themselves.

  • Missing - the number of documents in the results set which have no value for the facet field.

  • Choice of facet method (advanced) - specify Solr algorithm used to calculate facet counts. (See Facet Method Configuration for details). One of:

    • enum - small number of distinct categories

    • fc ("field cache") - many different values in the field, each document has low number of values, multi-valued field

    • fcs ("single value string fields") - good for rapidly changing indexes

For further details see: Solr Wiki Faceting Overview.

Configuration