Filter Search Results with a Slider

The Slider widget lets users easily filter within a given range.

Usage

The slider requires a query object, and either a fieldName or a facet object.

<widget:slider query="${query}" fieldName="rating" min="0" max="10" />
Note
If a fieldName is not provided, then a facet must be passed in.

If a facet is provided to the slider, the filters contained in that facet will be used for the actual and display values of the slider. When this is the case, the facet overrides several configuration parameters. First, the min parameter will be automatically set to 0, the max parameter will default to the number of filters present in the facet, displayTranslations and actualTranslations will automatically be set (based on information from the facet’s filters). Providing a facet also negates the need for a fieldName, and is incompatible with inverted="true". While it might seem like there are a lot of caveats, the truth of the matter is that providing a facet removes the need for more extensive configuration.

This is an example of how simple it is:

<widget:slider query="${query}" facet="${response.facets['ActualDate']}" />