Docs
Components
Refinement Facets
Rating Menu

Rating Menu

The rating menu widget displays a list of ratings. When a user clicks on a rating, the widget will trigger a new search with the corresponding rating filter.

Setup

The following document indexed in Elasticsearch:

{
  "brand": "Apple",
  "product": "Macbook Pro 14",
  "rating": 5
}

If your attribute is a float, we recommend indexing a new attribute with the rounded integer value to use in this widget.

Searchkit Setup

setup the following facet_attributes

{
  facet_attributes: [
    { 
      attribute: 'rating', 
      field: 'rating',  // field must be a integer 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

Documentation


Apache 2.0 2024 © Joseph McElroy.
Need help? Join discord