Faceting

Faceted Results

Faceting is the name given to a set of computed counts over a search result which are returned together with the documents which match the search query. Facets are most often used to create additional navigational controls on the search results page or panel which allow users to expand and restrict their search criteria in a natural way, without having to construct complicated queries. For example, popular e-commerce facets include product category, price range, availability, and user ratings.

Fusion leverages Solr’s Faceting search components.

In Solr the most straightforward kind of faceting is “Field Faceting”, in which Solr’s FacetComponent 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. Fusion’s Facet Query Stage can be used to configure field faceting as part of the search query pipeline.

Range Facets are used for fields which contain date or number values. A range facet query requires that you set up a specification of the range for each facet. There is no restriction on the set of ranges specified in this query.

Fusion’s Facet Query Stage sets up the proper field facet query parameters and adds them to the Fusion Pipeline Query Object. Range faceting, however, requires adding the range facet query parameters to the query object via Fusion’s Additional Query Parameters Stage

Key Facet Concepts:

  • Term – a specific value from a field.

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

  • Offset – the number of top facet values to skip in the response (just like paging through search results and choosing an offset of 51 to start on page 2 when showing 50 results per page).

  • 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