Use granular filterable attributes
By default, adding an attribute tofilterableAttributes enables equality filters, comparison filters, and facet search. Most attributes only need a subset of these features. Use granular filterable attributes to enable only what you need.
Choose the right features per attribute
| Attribute type | Example | Recommended features |
|---|---|---|
| Categories, tags, brands | genre, color, brand | filter.equality: true, facetSearch: true |
| Numeric ranges | price, rating, year | filter.equality: true, filter.comparison: true, facetSearch: false |
| Boolean flags | in_stock, is_featured | filter.equality: true, filter.comparison: false, facetSearch: false |
| Internal IDs used only for filtering | tenant_id, user_id | filter.equality: true, filter.comparison: false, facetSearch: false |
- Sets a restrictive default for all attributes (equality only, no facet search)
- Enables facet search only on categorical attributes that appear in your sidebar
- Enables comparison operators only on numeric attributes that need range filtering
Lower maxValuesPerFacet
ThemaxValuesPerFacet setting (default: 100) controls how many distinct values Meilisearch returns per attribute in the facetDistribution response. If your UI only displays 10 or 20 facet values per category, computing counts for 100 is unnecessary work.
maxValuesPerFacet to 10 or 15 (a small margin lets you implement “Show more” without a separate request).
For attributes with high cardinality (cities, tags, SKU variants), this setting has the largest impact on search latency.
Disable facet search
Facet search lets users type inside a facet group to find specific values (e.g., searching for “Nik” to find “Nike” in the brands facet). If you do not use this feature, disabling it reduces the data structures Meilisearch builds during indexing.Disable globally for an index
/indexes/{index_uid}/facet-search endpoint entirely. Documents are still indexed for regular facet distribution, but Meilisearch skips the additional processing needed for facet search.
Disable per attribute
If you need facet search on some attributes but not others, use granular filterable attributes instead of the global toggle:brand (which may have hundreds of values) and disables it on color, size, and in_stock (which have a small, known set of values).
Request only the facets you need
At search time, only include the attributes you need in thefacets parameter. Each attribute listed in facets requires Meilisearch to compute a count for every distinct value.
size, price, or rating in the facets array.
Summary
| Optimization | When to use | Impact |
|---|---|---|
| Granular filterable attributes | Always, when you have more than a few filterable attributes | Reduces indexing time and memory |
Lower maxValuesPerFacet | When attributes have many unique values | Reduces search latency |
| Disable facet search (global) | When you never use the facet search endpoint | Reduces indexing time |
| Disable facet search (per attribute) | When only some attributes need facet search | Reduces indexing time |
| Request fewer facets at search time | Always | Reduces search latency |
Next steps
Configure granular filters
Full guide to granular filterable attributes.
Build disjunctive facets
Implement faceted navigation where selecting a value does not collapse counts in the same group.
Debug search performance
Identify which part of the search pipeline is slow.