Settings
The /settings
route allows you to customize search settings for the given index. You can either modify all of an index's settings at once using the update settings endpoint, or modify each one individually using the child routes.
For a conceptual overview of index settings, refer to our indexes guide.
Settings object
By default, the settings object looks like this. All fields are modifiable.
{
"displayedAttributes": [
"*"
],
"searchableAttributes": [
"*"
],
"filterableAttributes": [],
"sortableAttributes": [],
"rankingRules":
[
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness"
],
"stopWords": [],
"synonyms": {},
"distinctAttribute": null,
"typoTolerance": {
"enabled": true,
"minWordSizeForTypos": {
"oneTypo": 5,
"twoTypos": 9
},
"disableOnWords": [],
"disableOnAttributes": []
},
"faceting": {
"maxValuesPerFacet": 100
},
"pagination": {
"maxTotalHits": 1000
}
}
All settings
This route allows you to retrieve, configure, or reset all of an index's settings at once.
Get settings
Get the settings of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings'
Response: 200 Ok
{
"displayedAttributes": [
"*"
],
"searchableAttributes": [
"*"
],
"filterableAttributes": [],
"sortableAttributes": [],
"rankingRules":
[
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness"
],
"stopWords": [],
"synonyms": {},
"distinctAttribute": null,
"typoTolerance": {
"enabled": true,
"minWordSizeForTypos": {
"oneTypo": 5,
"twoTypos": 9
},
"disableOnWords": [],
"disableOnAttributes": []
},
"faceting": {
"maxValuesPerFacet": 100
},
"pagination": {
"maxTotalHits": 1000
}
}
Update settings
Update the settings of an index.
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.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
Name | Type | Default value | Description |
---|---|---|---|
displayedAttributes | Array of strings | All attributes: ["*"] | Fields displayed in the returned documents |
distinctAttribute | String | null | Search returns documents with distinct (different) values of the given field |
faceting | Object | Default object | Faceting settings |
filterableAttributes | Array of strings | Empty | Attributes to use as filters and facets |
pagination | Object | Default object | Pagination settings |
rankingRules | Array of strings | ["words", "typo", "proximity", "attribute", "sort", "exactness"] | List of ranking rules in order of importance |
searchableAttributes | Array of strings | All attributes: ["*"] | Fields in which to search for matching query words sorted by order of importance |
sortableAttributes | Array of strings | Empty | Attributes to use when sorting search results |
stopWords | Array of strings | Empty | List of words ignored by Meilisearch when present in search queries |
synonyms | Object | Empty | List of associated words treated similarly |
typoTolerance | Object | Default 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
Reset all the settings of an index to their default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
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.
Displayed attributes
The attributes added to the displayedAttributes
list appear in search results. displayedAttributes
only affects the search endpoints. It has no impact on the GET documents endpoint.
By default, the displayedAttributes
array is equal to all fields in your dataset. This behavior is represented by the value ["*"]
.
To learn more about displayed attributes, refer to our dedicated guide.
Get displayed attributes
Get the displayed attributes of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/displayed-attributes'
Response: 200 Ok
[
"title",
"overview",
"genres",
"release_date.year"
]
Update displayed attributes
Update the displayed attributes of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
[<String>, <String>, …]
An array of strings. Each string should be an attribute that exists in the selected index.
If an attribute contains an object, you can use dot notation to specify one or more of its keys, for example, "displayedAttributes": ["release_date.year"]
.
WARNING
If the field does not exist, no error will be thrown.
Example
curl \
-X PUT 'http://localhost:7700/indexes/movies/settings/displayed-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"title",
"overview",
"genres",
"release_date"
]'
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 displayed attributes
Reset the displayed attributes of the index to the default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/displayed-attributes'
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.
Distinct attribute
The distinct attribute is a field whose value will always be unique in the returned documents.
WARNING
Updating distinct attributes will re-index all documents in the index, which can take some time. We recommend updating your index settings first and then adding documents as this reduces RAM consumption.
To learn more about the distinct attribute, refer to our dedicated guide.
Get distinct attribute
Get the distinct attribute of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/shoes/settings/distinct-attribute'
Response: 200 Ok
"skuid"
Update distinct attribute
Update the distinct attribute field of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
<String>
A string. The string should be an attribute that exists in the selected index.
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, for example, "distinctAttribute": "product.skuid"
.
WARNING
If the field does not exist, no error will be thrown.
To learn more about the distinct attribute, refer to our dedicated guide.
Example
curl \
-X PUT 'http://localhost:7700/indexes/shoes/settings/distinct-attribute' \
-H 'Content-Type: application/json' \
--data-binary '"skuid"'
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 distinct attribute
Reset the distinct attribute of an index to its default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/shoes/settings/distinct-attribute'
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.
Faceting
With Meilisearch, you can create faceted search interfaces. This setting allows you to define the maximum number of values returned by the facets
search parameter.
To learn more about faceting, refer to our dedicated guide.
Faceting object
Name | Type | Default value | Description |
---|---|---|---|
maxValuesPerFacet | Integer | 100 | Maximum number of facet values returned for each facet. Values are sorted in ascending lexicographical order |
Get faceting settings
Get the faceting settings of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/books/settings/faceting'
Response: 200 OK
{
"maxValuesPerFacet": 100
}
Update faceting settings
Partially update the faceting settings for an index. Any parameters not provided in the body will be left unchanged.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
{maxValuesPerFacet: <Integer>}
Name | Type | Default value | Description |
---|---|---|---|
maxValuesPerFacet | Integer | 100 | Maximum number of facet values returned for each facet. Values are sorted in ascending lexicographical order |
For example, suppose a query's search results contain a total of three values for a colors
facet: blue
, green
, and red
. If you set maxValuesPerFacet
to 2
, Meilisearch will only return blue
and green
in the response body's facetDistribution
object.
NOTE
Setting maxValuesPerFacet
to a high value might negatively impact performance.
Example
curl \
-X PATCH 'http://localhost:7700/indexes/books/settings/faceting' \
-H 'Content-Type: application/json' \
--data-binary '{
"maxValuesPerFacet": 2
}'
Response: 202 Accepted
{
"taskUid": 1,
"indexUid": "books",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2022-04-14T20:56:44.991039Z"
}
You can use the returned taskUid
to get more details on the status of the task.
Reset faceting settings
Reset an index's faceting settings to their default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/books/settings/faceting'
Response: 200 OK
{
"taskUid": 1,
"indexUid": "books",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2022-04-14T20:53:32.863107Z"
}
You can use the returned taskUid
to get more details on the status of the task.
Filterable attributes
Attributes in the filterableAttributes
list can be used as filters or facets.
WARNING
Updating filterable attributes will re-index all documents in the index, which can take some time. We recommend updating your index settings first and then adding documents as this reduces RAM consumption.
To learn more about filterable attributes, refer to our dedicated guide.
Get filterable attributes
Get the filterable attributes for an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
Response: 200 Ok
[
"genres",
"director",
"release_date.year"
]
Update filterable attributes
Update an index's filterable attributes list.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
[<String>, <String>, …]
An array of strings containing the attributes that can be used as filters at query time.
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"]
.
WARNING
If the field does not exist, no error will be thrown.
To learn more about filterable attributes, refer to our dedicated guide.
Example
curl \
-X PUT 'http://localhost:7700/indexes/movies/settings/filterable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"genres",
"director"
]'
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 filterable attributes
Reset an index's filterable attributes list back to its default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/filterable-attributes'
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.
Pagination
To protect your database from malicious scraping, Meilisearch has a default limit of 1000 results per search. This setting allows you to configure the maximum number of results returned per search.
maxTotalHits
takes priority over search parameters such as limit
, offset
, hitsPerPage
, and page
.
For example, if you set maxTotalHits
to 100, you will not be able to access search results beyond 100 no matter the value configured for offset
.
To learn more about paginating search results with Meilisearch, refer to our dedicated guide.
Pagination object
Name | Type | Default value | Description |
---|---|---|---|
maxTotalHits | Integer | 1000 | The maximum number of search results Meilisearch can return |
Get pagination settings
Get the pagination settings of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/books/settings/pagination'
Response: 200 OK
{
"maxTotalHits": 1000
}
Update pagination settings
Partially update the pagination settings for an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
{maxTotalHits: <Integer>}
Name | Type | Default value | Description |
---|---|---|---|
maxTotalHits | Integer | 1000 | The maximum number of search results Meilisearch can return |
WARNING
Setting maxTotalHits
to a value higher than the default will negatively impact search performance. Setting maxTotalHits
to values over 20000
may result in queries taking seconds to complete.
Example
curl \
-X PATCH 'http://localhost:7700/indexes/books/settings/pagination' \
-H 'Content-Type: application/json' \
--data-binary '{
"maxTotalHits": 100
}'
Response: 202 Accepted
{
"taskUid": 1,
"indexUid": "books",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2022-04-14T20:56:44.991039Z"
}
You can use the returned taskUid
to get more details on the status of the task.
Reset pagination settings
Reset an index's pagination settings to their default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/books/settings/pagination'
Response: 202 Accepted
{
"taskUid": 1,
"indexUid": "books",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2022-04-14T20:53:32.863107Z"
}
You can use the returned taskUid
to get more details on the status of the task.
Ranking rules
Ranking rules are built-in rules that rank search results according to certain criteria. They are applied in the same order in which they appear in the rankingRules
array.
To learn more about ranking rules, refer to our dedicated guide.
Ranking rules array
Name | Description |
---|---|
"words" | Sorts results by decreasing number of matched query terms |
"typo" | Sorts results by increasing number of typos |
"proximity" | Sorts results by increasing distance between matched query terms |
"attribute" | Sorts results based on the attribute ranking order |
"sort" | Sorts results based on parameters decided at query time |
"exactness" | Sorts results based on the similarity of the matched words with the query words |
Default order
[
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness"
]
Get ranking rules
Get the ranking rules of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/ranking-rules'
Response: 200 Ok
[
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"release_date:desc"
]
Update ranking rules
Update the ranking rules of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
[<String>, <String>, …]
An array that contains ranking rules in order of importance.
To create a custom ranking rule, give an attribute followed by a colon (:
) and either asc
for ascending order or desc
for descending order.
- To apply an ascending sort (results sorted by increasing value):
attribute_name:asc
- To apply a descending sort (results sorted by decreasing value):
attribute_name:desc
WARNING
If some documents do not contain the attribute defined in a custom ranking rule, the application of the ranking rule is undefined and the search results might not be sorted as you expected.
Make sure that any attribute used in a custom ranking rule is present in all of your documents. For example, if you set the custom ranking rule desc(year)
, make sure that all your documents contain the attribute year
.
To learn more about ranking rules, refer to our dedicated guide.
Example
curl \
-X PUT 'http://localhost:7700/indexes/movies/settings/ranking-rules' \
-H 'Content-Type: application/json' \
--data-binary '[
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"release_date:asc",
"rank:desc"
]'
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 ranking rules
Reset the ranking rules of an index to their default value.
TIP
Resetting ranking rules is not the same as removing them. To remove a ranking rule, use the update ranking rules endpoint.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/ranking-rules'
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.
Searchable attributes
The values associated with attributes in the searchableAttributes
list are searched for matching query words. The order of the list also determines the attribute ranking order.
By default, the searchableAttributes
array is equal to all fields in your dataset. This behavior is represented by the value ["*"]
.
WARNING
Updating searchable attributes will re-index all documents in the index, which can take some time. We recommend updating your index settings first and then adding documents as this reduces RAM consumption.
To learn more about searchable attributes, refer to our dedicated guide.
Get searchable attributes
Get the searchable attributes of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/searchable-attributes'
Response: 200 Ok
[
"title",
"overview",
"genres",
"release_date.year"
]
Update searchable attributes
Update the searchable attributes of an index.
WARNING
Due to an implementation bug, manually updating searchableAttributes
will change the displayed order of document fields in the JSON response. This behavior is inconsistent and will be fixed in a future release.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
[<String>, <String>, …]
An array of strings. Each string should be an attribute that exists in the selected index. The array should be given in order of importance: from the most important attribute to the least important attribute.
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: "searchableAttributes": ["release_date.year"]
.
WARNING
If the field does not exist, no error will be thrown.
To learn more about searchable attributes, refer to our dedicated guide.
Example
curl \
-X PUT 'http://localhost:7700/indexes/movies/settings/searchable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"title",
"overview",
"genres"
]'
In this example, a document with a match in title
will be more relevant than another document with a match in overview
.
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 searchable attributes
Reset the searchable attributes of the index to the default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/searchable-attributes'
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.
Sortable attributes
Attributes that can be used when sorting search results using the sort
search parameter.
WARNING
Updating sortable attributes will re-index all documents in the index, which can take some time. We recommend updating your index settings first and then adding documents as this reduces RAM consumption.
To learn more about sortable attributes, refer to our dedicated guide.
Get sortable attributes
Get the sortable attributes of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/books/settings/sortable-attributes'
Response: 200 Ok
[
"price",
"author.surname"
]
Update sortable attributes
Update an index's sortable attributes list.
You can read more about sorting at query time on our dedicated guide.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
[<String>, <String>, …]
An array of strings. Each string should be an attribute that exists in the selected index.
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: "sortableAttributes": ["author.surname"]
.
WARNING
If the field does not exist, no error will be thrown.
To learn more about sortable attributes, refer to our dedicated guide.
Example
curl \
-X PUT 'http://localhost:7700/indexes/books/settings/sortable-attributes' \
-H 'Content-Type: application/json' \
--data-binary '[
"price",
"author"
]'
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 sortable attributes
Reset an index's sortable attributes list back to its default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/books/settings/sortable-attributes'
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.
Stop words
Words added to the stopWords
list are ignored in future search queries.
WARNING
Updating stop words will re-index all documents in the index, which can take some time. We recommend updating your index settings first and then adding documents as this reduces RAM consumption.
TIP
Stop words are strongly related to the language used in your dataset. For example, most datasets containing English documents will have countless occurrences of the
and of
. Italian datasets, instead, will benefit from ignoring words like a
, la
, or il
.
This website maintained by a French developer offers lists of possible stop words in different languages. Note that, depending on your dataset and use case, you will need to tweak these lists for optimal results.
Get stop words
Get the stop words list of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/stop-words'
Response: 200 Ok
[
"of",
"the",
"to"
]
Update stop words
Update the list of stop words of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
[<String>, <String>, …]
An array of strings. Each string should be a single word.
If a list of stop words already exists, it will be overwritten (replaced).
Example
curl \
-X PUT 'http://localhost:7700/indexes/movies/settings/stop-words' \
-H 'Content-Type: application/json' \
--data-binary '[
"the",
"of",
"to"
]'
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 stop words
Reset the list of stop words of an index to its default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/stop-words'
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.
Synonyms
The synonyms
object contains words and their respective synonyms. A synonym in Meilisearch is considered equal to its associated word for the purposes of calculating search results.
To learn more about synonyms, refer to our dedicated guide.
Get synonyms
Get the list of synonyms of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/synonyms'
Response: 200 OK
{
"wolverine": [
"xmen",
"logan"
],
"logan": [
"wolverine",
"xmen"
],
"wow": [
"world of warcraft"
]
}
Update synonyms
Update the list of synonyms of an index. Synonyms are normalized.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
{
<String>: [<String>, <String>, …],
…
}
An object that contains all synonyms and their associated words. Add the associated words in an array to set a synonym for a word.
To learn more about synonyms, refer to our dedicated guide.
Example
curl \
-X PUT 'http://localhost:7700/indexes/movies/settings/synonyms' \
-H 'Content-Type: application/json' \
--data-binary '{
"wolverine": [
"xmen",
"logan"
],
"logan": [
"wolverine",
"xmen"
],
"wow": ["world of warcraft"]
}'
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 synonyms
Reset the list of synonyms of an index to its default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/synonyms'
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.
Typo tolerance
Typo tolerance helps users find relevant results even when their search queries contain spelling mistakes or typos. This setting allows you to configure the minimum word size for typos and disable typo tolerance for specific words or attributes.
To learn more about typo tolerance, refer to our dedicated guide.
Typo tolerance object
Name | Type | Default Value | Description |
---|---|---|---|
enabled | Boolean | true | Whether typo tolerance is enabled or not |
minWordSizeForTypos.oneTypo | Integer | 5 | The minimum word size for accepting 1 typo; must be between 0 and twoTypos |
minWordSizeForTypos.twoTypos | Integer | 9 | The minimum word size for accepting 2 typos; must be between oneTypo and 255 |
disableOnWords | Array of strings | Empty | An array of words for which the typo tolerance feature is disabled |
disableOnAttributes | Array of strings | Empty | An array of attributes for which the typo tolerance feature is disabled |
Get typo tolerance settings
Get the typo tolerance settings of an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X GET 'http://localhost:7700/indexes/books/settings/typo-tolerance'
Response: 200 OK
{
"enabled": true,
"minWordSizeForTypos": {
"oneTypo": 5,
"twoTypos": 9
},
"disableOnWords": [],
"disableOnAttributes": []
}
Update typo tolerance settings
Partially update the typo tolerance settings for an index.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Body
{
"enabled": <Boolean>,
"minWordSizeForTypos": {
"oneTypo": <Integer>,
"twoTypos": <Integer>
},
"disableOnWords": [<String>, <String>, …],
"disableOnAttributes": [<String>, <String>, …]
}
Name | Type | Default Value | Description |
---|---|---|---|
enabled | Boolean | true | Whether typo tolerance is enabled or not |
minWordSizeForTypos.oneTypo | Integer | 5 | The minimum word size for accepting 1 typo; must be between 0 and twoTypos |
minWordSizeForTypos.twoTypos | Integer | 9 | The minimum word size for accepting 2 typos; must be between oneTypo and 255 |
disableOnWords | Array of strings | Empty | An array of words for which the typo tolerance feature is disabled |
disableOnAttributes | Array of strings | Empty | An array of attributes for which the typo tolerance feature is disabled |
Example
curl \
-X PATCH 'http://localhost:7700/indexes/books/settings/typo-tolerance' \
-H 'Content-Type: application/json' \
--data-binary '{
"minWordSizeForTypos": {
"oneTypo": 4,
"twoTypos": 10
},
"disableOnAttributes": ["title"]
}'
Response: 202 Accepted
{
"taskUid": 1,
"indexUid": "books",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2022-04-14T20:56:44.991039Z"
}
You can use the returned taskUid
to get more details on the status of the task.
Reset typo tolerance settings
Reset an index's typo tolerance settings to their default value.
Path parameters
Name | Type | Description |
---|---|---|
index_uid * | String | uid of the requested index |
Example
curl \
-X DELETE 'http://localhost:7700/indexes/books/settings/typo-tolerance'
Response: 202 Accepted
{
"taskUid": 1,
"indexUid": "books",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2022-04-14T20:53:32.863107Z"
}
You can use the returned taskUid
to get more details on the status of the task.