The Field Facet query pipeline 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 is 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.
The Boost Values, Bury Values, Suppress Values, and Display Order fields are available in Fusion 5.17 and later.
In the Facet Fields settings, use these fields to change the order of values within a facet:
Boost Values. Move these values to the top of the facet, in the order you list them.
Bury Values. Move these values to the bottom of the facet.
Suppress Values. Remove these values from the facet.
Values that aren’t listed keep the order that Solr returns.Boost, bury, and suppress require a Modify Response stage in the same pipeline.
Place the Modify Response stage after both the Field Facet stage and the Solr Query stage.
If the Modify Response stage is missing or runs before either of those stages, the facet values aren’t reordered.Keep these matching rules in mind:
Values must exactly match the facet values that Solr returns. Matching is case-sensitive and doesn’t support partial matches.
If a value appears in Suppress Values and in Boost Values or Bury Values, the value is suppressed.
Don’t list the same value in both Boost Values and Bury Values.
Use Display Order to control the order in which facets appear in the response.
Facets with lower values appear first.
Facets without a value appear after all ordered facets.Display Order doesn’t require a Modify Response stage.
Faceting
The course for Faceting focuses on how to use facets to ensure faster, smarter search results.
Stages can be triggered conditionally when a script in the Condition field evaluates to true.
Some examples are shown below.Run this stage only for mobile clients:
params.deviceType === "mobile"
Run this stage when debugging is enabled:
params.debug === "true"
Run this stage when the query includes a specific term:
The first condition checks that the request parameter “fusion-user-name” is present and has the value “SuperUser”.
The second condition checks that the request parameter “isFusionPluginQuery” is not present.
When entering configuration values in the UI, use unescaped characters, such as \t for the tab character. When entering configuration values in the API, use escaped characters, such as \\t for the tab character.