# All settings
The /settings route allows you to customize search settings for the given index. It is possible to modify all of an index's settings at once using the update settings endpoint, or modify each one individually using the child routes.
These are the reference pages for the child routes:
- Displayed attributes
- Distinct attribute
- Faceting
- Filterable attributes
- Pagination
- Ranking rules
- Searchable attributes
- Sortable attributes
- Stop-words
- Synonyms
- Typo tolerance
To learn more about settings, refer to our dedicated guide.
WARNING
When you update a setting, you overwrite its default value. Use the DELETE route to reset any setting to its original value.
# Get settings
/indexes/{index_uid}/settingsGet the settings of an index. The index uid is required.
Learn more about the settings.
# Response body
| Variable | Type | Description | Default value |
|---|---|---|---|
| displayedAttributes | [Strings] | Fields displayed in the returned documents | ["*"] (all attributes) |
| distinctAttribute | String | Search returns documents with distinct (different) values of the given field | null |
| faceting | Object | Faceting settings | {} |
| filterableAttributes | [Strings] | Attributes to use as filters and facets | [] |
| pagination | Object | Pagination settings | {} |
| rankingRules | [Strings] | List of ranking rules sorted by order of importance | A list of ordered built-in ranking rules |
| searchableAttributes | [Strings] | Fields in which to search for matching query words sorted by order of importance | ["*"] (all attributes) |
| sortableAttributes | [Strings] | Attributes to use when sorting search results | [] |
| stopWords | [Strings] | List of words ignored by Meilisearch when present in search queries | [] |
| synonyms | Object | List of associated words treated similarly | {} |
| typoTolerance | Object | Typo tolerance settings | {} |
Learn more about the settings in this guide.
# Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings'
# Response: 200 Ok
List the settings.
{
"rankingRules": [
"typo",
"words",
"proximity",
"attribute",
"words",
"exactness",
"desc(release_date)"
],
"filterableAttributes": [
"genres"
],
"distinctAttribute": null,
"searchableAttributes": [
"title",
"overview",
"genres"
],
"displayedAttributes": [
"title",
"overview",
"genres",
"release_date"
],
"stopWords": null,
"synonyms": {
"wolverine": [
"xmen",
"logan"
],
"logan": [
"wolverine",
"xmen"
]
},
"typoTolerance": {
"enabled": true,
"minWordSizeForTypos": {
"oneTypo": 5,
"twoTypos": 10
},
"disableOnWords": [],
"disableOnAttributes": []
},
"pagination": {
"maxTotalHits": 1000
},
"faceting": {
"maxValuesPerFacet": 100
}
}
# Update settings
/indexes/{index_uid}/settingsUpdate the settings of an index. The index uid is required.
Passing null to an index setting will reset it to its default value.
Updates in the settings route are partial. This means that any parameters not provided in the body will be left unchanged.
If the provided index does not exist, it will be created.
Learn more about the settings in this guide.
# Body
| Variable | Type | Description | Default value |
|---|---|---|---|
| displayedAttributes | [Strings] | Fields displayed in the returned documents | ["*"] (all attributes) |
| distinctAttribute | String | Search returns documents with distinct (different) values of the given field | null |
| faceting | Object | Faceting settings | {} |
| filterableAttributes | [Strings] | Attributes to use as filters and facets | [] |
| pagination | Object | Pagination settings | {} |
| rankingRules | [Strings] | List of ranking rules sorted by order of importance | A list of ordered built-in ranking rules |
| searchableAttributes | [Strings] | Fields in which to search for matching query words sorted by order of importance | ["*"] (all attributes) |
| sortableAttributes | [Strings] | Attributes to use when sorting search results | [] |
| stopWords | [Strings] | List of words ignored by Meilisearch when present in search queries | [] |
| synonyms | Object | List of associated words treated similarly | {} |
| typoTolerance | Object | Typo tolerance settings | {} |
# Example
curl \
-X PATCH 'http://localhost:7700/indexes/movies/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"rankingRules": [
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"release_date:desc",
"rank:desc"
],
"distinctAttribute": "movie_id",
"searchableAttributes": [
"title",
"overview",
"genres"
],
"displayedAttributes": [
"title",
"overview",
"genres",
"release_date"
],
"stopWords": [
"the",
"a",
"an"
],
"sortableAttributes": [
"title",
"release_date"
],
"synonyms": {
"wolverine": [
"xmen",
"logan"
],
"logan": ["wolverine"]
},
"typoTolerance": {
"minWordSizeForTypos": {
"oneTypo": 8,
"twoTypos": 10
},
"disableOnAttributes": ["title"]
},
"pagination": {
"maxTotalHits": 5000
},
"faceting": {
"maxValuesPerFacet": 200
}
}'
# Response: 202 Accepted
{
"taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
You can use this taskUid to get more details on the status of the task.
# Reset settings
/indexes/{index_uid}/settingsReset the settings of an index. The index uid is required.
All settings will be reset to their default value.
| Variable | Type | Description | Default value |
|---|---|---|---|
| displayedAttributes | [Strings] | Fields displayed in the returned documents | ["*"] (all attributes) |
| distinctAttribute | String | Search returns documents with distinct (different) values of the given field | null |
| faceting | Object | Faceting settings | {} |
| filterableAttributes | [Strings] | Attributes to use as filters and facets | [] |
| pagination | Object | Pagination settings | {} |
| rankingRules | [Strings] | List of ranking rules sorted by order of importance | A list of ordered built-in ranking rules |
| searchableAttributes | [Strings] | Fields in which to search for matching query words sorted by order of importance | ["*"] (all attributes) |
| sortableAttributes | [Strings] | Attributes to use when sorting search results | [] |
| stopWords | [Strings] | List of words ignored by Meilisearch when present in search queries | [] |
| synonyms | Object | List of associated words treated similarly | {} |
| typoTolerance | Object | Typo tolerance settings | {} |
Learn more about the settings.
# Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings'
# Response: 202 Accepted
{
"taskUid": 1,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2021-08-11T09:25:53.000000Z"
}
You can use this taskUid to get more details on the status of the task.