# Filterable attributes
Child route of the settings route.
Filterable attributes can also be updated through the global settings route.
Attributes that can be used as filters for filtering and faceted search. To learn more about filterable attributes, refer to our dedicated guide.
WARNING
Updating the settings means overwriting the default settings of Meilisearch. You can reset to default values using the DELETE
routes.
# Get filterable attributes
/indexes/{index_uid}/settings/filterable-attributes
Get an index's filterableAttributes
. The index uid
is required.
# Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
# Response: 200 Ok
List the settings.
[
"genres",
"director",
"release_date.year"
]
# Update filterable attributes
/indexes/{index_uid}/settings/filterable-attributes
Update an index's filterable attributes list. This will re-index all documents in the index. The index uid
is required.
If an attribute contains an object, you can use dot notation to set one or more of its keys as a value for this setting: "filterableAttributes": ["release_date.year"]
.
# Body
An array of strings containing the attributes that can be used as filters at query time.
You can read more about this setting at the feature reference page.
# Example
curl \
-X POST 'http://localhost:7700/indexes/movies/settings/filterable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"genres",
"director"
]'
# Response: 202 Accepted
{
"uid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
You can use this uid
to get more details on the status of the task.
# Reset filterable attributes
/indexes/{index_uid}/settings/filterable-attributes
Reset an index's filterable attributes list back to its default value. The index uid
is required.
# Default value
An empty array ([]
).
# Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
# Response: 202 Accepted
{
"uid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
You can use this uid
to get more details on the status of the task.