Docs
Components
Refinement Facets
Menu Select

Menu Select

Menu Select is a widget that displays a list of values inside a select dropdown menu.

Setup

The following document indexed in Elasticsearch:

{
  "brand": "Apple",
  "product": "Macbook Pro 14",
  "category": "Electronics"
}

alternatively could be indexed as array if document is part of multiple categories:

{
  "brand": "Apple",
  "product": "Macbook Pro 14",
  "category": ["Electronics", "School Equipment"]
}

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

Searchkit Setup

setup the following facet_attributes

{
  facet_attributes: [
    { 
      attribute: 'category_lvl1', 
      field: 'category.keyword',  // field must be a keyword type field
      type: 'string' 
    }
  ]
}
 

Documentation


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