Skip to main content
By default, Meilisearch searches through all document fields. Use the searchableAttributes setting to limit which fields are searchable and control their relative importance in the attribute ranking order. This also affects ranking rules that depend on attribute order.

Why configure searchable attributes

There are two main reasons to customize searchable attributes:
  1. Improve relevancy: Fields listed earlier in the searchableAttributes array have a greater impact on relevancy. If a match is found in the first attribute, that document ranks higher than one where the match appears in a later attribute.
  2. Improve performance: Reducing the number of searchable fields means Meilisearch has less data to scan during each query, which can speed up search on large datasets.
For example, in a movies index with fields like id, title, overview, genres, and release_date, you probably want title to carry the most weight, followed by overview and genres. The id and release_date fields are not useful for text search and can be excluded.

Check current searchable attributes

Retrieve the current searchableAttributes setting for an index:
curl \
  -X GET 'MEILISEARCH_URL/indexes/movies/settings/searchable-attributes'
By default, the response is ["*"], meaning all attributes are searchable in their order of appearance.

Update searchable attributes

Set the searchableAttributes list to control which fields are searchable and their ranking order. Fields listed first have the highest impact on relevancy:
curl \
  -X PUT 'MEILISEARCH_URL/indexes/movies/settings/searchable-attributes' \
  -H 'Content-Type: application/json' \
  --data-binary '[
    "title",
    "overview",
    "genres"
  ]'
This configuration makes title the most important searchable field, followed by overview, then genres. Fields not in the list (such as id and release_date) are no longer searchable.
Updating searchableAttributes triggers a re-indexing of all documents in the index. This is an asynchronous operation. Use the task API to monitor progress.
After manually updating searchableAttributes, new attributes found in subsequently indexed documents will not be automatically added to the list. You must either include them manually or reset the setting.

Reset searchable attributes

Reset searchableAttributes to its default value (["*"]), making all fields searchable again:
curl \
  -X DELETE 'MEILISEARCH_URL/indexes/movies/settings/searchable-attributes'
After resetting, new attributes will once again be automatically added to the searchable attributes list as documents are indexed.

Restrict searchable attributes at query time

If you need to limit which attributes are searched for a specific query without changing the index setting, use the attributesToSearchOn search parameter:
curl \
  -X POST 'MEILISEARCH_URL/indexes/movies/search' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "q": "adventure",
    "attributesToSearchOn": ["title"]
  }'
This searches only the title field for this request, regardless of the index-level searchableAttributes setting. The attributes specified must be a subset of the configured searchableAttributes.
For more details on how searchable and displayed attributes work together, see displayed and searchable attributes. For the full API reference, see get searchable attributes.