Update settings
Update the settings of an index.
Updates in the settings route are partial. This means that any parameters not provided in the body will be left unchanged. Learn more about the settings in this guide.
If the provided index does not exist, it will be created.
Headers
-
Content-Type string Required
Payload content-type
Value is
application/json
.
Path parameters
-
indexUid string Required
Index Unique Identifier
Body Required
-
synonyms object
List of associated words treated similarly. A word associated to an array of word as synonyms.
-
stopWords array[string]
List of words ignored when present in search queries.
-
rankingRules array[string]
List of ranking rules sorted by order of importance. The order is customizable.
-
distinctAttribute string | null
Search returns documents with distinct (different) values of the given field.
-
searchableAttributes array[string]
Fields in which to search for matching query words sorted by order of importance.
-
displayedAttributes array[string]
Fields displayed in the returned documents.
-
filterableAttributes array[string]
Attributes to use for faceting and filtering. See Filtering and Faceted Search.
-
sortableAttributes array[string]
List of attributes to sort on at search.
-
typoTolerance object
Customize typo tolerance feature.
-
pagination object
Customize pagination settings
-
faceting object
Customize faceting settings
curl \
-X PATCH https://example.meilisearch.com:7700/indexes/movies/settings \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"synonyms":{"wolverine":["xmen","logan"],"logan":["wolverine","xmen"],"wow":["world of warcraft"]},"stopWords":["of","the","to"],"rankingRules":["words","typo","proximity","attribute","sort","exactness","release_date:asc"],"distinctAttribute":"ean13","searchableAttributes":["title","description","genre"],"displayedAttributes":["title","description","genre","release_date"],"filterableAttributes":[],"sortableAttributes":null,"typoTolerance":{"enabled":false,"disableOnAttributes":["title","author"],"disableOnWords":["Tolkien"],"minWordSizeForTypos":{"oneTypo":4,"twoTypos":8}},"pagination":{"maxTotalHits":1000},"faceting":{"maxValuesPerFacet":100,"sortFacetValuesBy":{"*":"alpha"}}}'
# Headers
Content-Type: application/json
# Payload
{
"synonyms": {
"wolverine": [
"xmen",
"logan"
],
"logan": [
"wolverine",
"xmen"
],
"wow": [
"world of warcraft"
]
},
"stopWords": [
"of",
"the",
"to"
],
"rankingRules": [
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"release_date:asc"
],
"distinctAttribute": "ean13",
"searchableAttributes": [
"title",
"description",
"genre"
],
"displayedAttributes": [
"title",
"description",
"genre",
"release_date"
],
"filterableAttributes": [],
"sortableAttributes": null,
"typoTolerance": {
"enabled": false,
"disableOnAttributes": [
"title",
"author"
],
"disableOnWords": [
"Tolkien"
],
"minWordSizeForTypos": {
"oneTypo": 4,
"twoTypos": 8
}
},
"pagination": {
"maxTotalHits": 1000
},
"faceting": {
"maxValuesPerFacet": 100,
"sortFacetValuesBy": {
"*": "alpha"
}
}
}
{
"taskUid": 0,
"indexUid": "movies",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2021-01-01T09:39:00.000000Z"
}
{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}