Range Slider
Range slider is a widget that allows the user to refine the range of a numeric attribute. It is a slider with two handles that can be moved to adjust the range. It calculates the min and max values of the attribute using the stats aggregation.
Setup
The following document indexed in Elasticsearch:
{
"brand": "Apple",
"product": "Macbook Pro 14",
"price": 2000
}
Searchkit Setup
setup the following facet_attributes
{
facet_attributes: [
{
attribute: 'price',
field: 'price', // field must be a numeric type field
type: 'numeric'
}
]
}
Nested Fields
You can also use nested fields to define facet attributes. This is useful for when you need to perserve object relationships. Read more about nested fields here