Search documents, configure and manage the Meilisearch engine.
This is the documentation for version 0.27.0
of the API. Last update on May 16, 2022.
This API is provided under license MIT.
https://example.meilisearch.com:7700
Search documents, configure and manage the Meilisearch engine.
This is the documentation for version 0.27.0
of the API. Last update on May 16, 2022.
This API is provided under license MIT.
https://example.meilisearch.com:7700
An API key is a token that you provide when making API calls. Include the token in a header parameter called Authorization
.
Example: Authorization: Bearer 8fece4405662dd830e4cb265e7e047aab2e79672a760a12712d2a263c9003509
Triggers a dump creation process. Once the process is complete, a dump is created in the dumps directory. If the dumps directory does not exist yet, it will be created.
Accepted
Unique identifier for the dump
Status of the dump
Values are in_progress
, failed
, or done
.
An RFC 3339
format for date/time/duration.
An RFC 3339
format for date/time/duration.
Unauthorized
curl \
-X POST https://example.meilisearch.com:7700/dumps \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": "20210719-114144097",
"status": "in_progress",
"startedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Get the status of a dump creation process using the uid returned after calling the dump creation route.
The returned status could be:
in_progress
: Dump creation is in progress.failed
: An error occured during dump process, and the task was aborted.done
: Dump creation is finished and was successful.Ok
Unique identifier for the dump
Status of the dump
Values are in_progress
, failed
, or done
.
An RFC 3339
format for date/time/duration.
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X GET https://example.meilisearch.com:7700/dumps/{dumpUid}/status \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": "20210719-114144097",
"status": "done",
"startedAt": "2021-07-19T14:31:16.920473Z",
"finishedAt": "2021-07-19T14:32:16.920473Z"
}
{
"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"
}
{
"message": "Dump `20201001-110357260` not found",
"code": "dump_not_found",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#dump_not_found"
}
curl \
-X GET https://example.meilisearch.com:7700/health
{
"status": "available"
}
Ok
Unique identifier for the index
Name of the index
Custom primaryKey for documents
An RFC 3339
format for date/time/duration.
An RFC 3339
format for date/time/duration.
Unauthorized
curl \
-X GET https://example.meilisearch.com:7700/indexes \
-H "Authorization: Bearer $ACCESS_TOKEN"
[
{
"uid": "movies",
"name": "movies",
"primaryKey": "movie_id",
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T09:40:33.711324Z"
}
]
{
"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"
}
Payload content-type
Values are application/json
.
Created
Unique identifier for the index
Name of the index
Custom primaryKey for documents
An RFC 3339
format for date/time/duration.
An RFC 3339
format for date/time/duration.
Bad Request
Unauthorized
curl \
-X POST https://example.meilisearch.com:7700/indexes \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"uid":"movies","primaryKey":"movie_id"}'
# Headers
Content-Type: application/json
# Payload
{
"uid": "movies",
"primaryKey": "movie_id"
}
{
"uid": "movies",
"name": "movies",
"primaryKey": "movie_id",
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T09:40:33.711324Z"
}
{
"message": "Index `:indexUid` already exists.",
"code": "index_already_exists",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#index_already_exists"
}
{
"message": "`:indexUid` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).",
"code": "invalid_index_uid",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_index_uid"
}
{
"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"
}
OK
Unique identifier for the index
Name of the index
Custom primaryKey for documents
An RFC 3339
format for date/time/duration.
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid} \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": "movies",
"name": "movies",
"primaryKey": "movie_id",
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T09:40:33.711324Z"
}
{
"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"
}
Update an index. Add a primaryKey if it doesn't already exists yet.
Payload content-type
Values are application/json
.
Ok
Unique identifier for the index
Name of the index
Custom primaryKey for documents
An RFC 3339
format for date/time/duration.
An RFC 3339
format for date/time/duration.
Bad Request
Unauthorized
Not Found
curl \
-X PUT https://example.meilisearch.com:7700/indexes/{indexUid} \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"primaryKey":"string"}'
# Headers
Content-Type: application/json
# Payload
{
"primaryKey": "string"
}
{
"uid": "movies",
"name": "movies",
"primaryKey": "movie_id",
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T09:40:33.711324Z"
}
{
"message": "Index `:indexUid` already has a primary key.",
"code": "index_primary_key_already_exists",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#index_primary_key_already_exists"
}
{
"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"
}
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid} \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"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"
}
Maximum number of documents to return.
Default value is 20
.
Number of documents to skip.
Default value is 0
.
Comma-separated list of attributes whose fields will be present in the returned documents. Defaults to the displayedAttributes list which contains by default all attributes found in the documents.
Default value is *
.
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/documents \
-H "Authorization: Bearer $ACCESS_TOKEN"
[
{
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
"release_date": "1993-01-01"
}
]
{
"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"
}
Add a list of documents or update them if they already exist.
If you send an already existing document (same id) the old document will be only partially updated according to the fields of the new document. Thus, any fields not present in the new document are kept and remained unchanged.
To completely overwrite a document, see Add or replace documents route.
If the provided index does not exist, it will be created.
Use the reserved _geo
object to add geo coordinates to a document. _geo
is an object made of lat
and lng
field.
The content-type associated with the format to be indexed
Values are application/json
, text/csv
, or application/x-ndjson
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Payload Too Large
curl \
-X PUT https://example.meilisearch.com:7700/indexes/{indexUid}/documents \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '[{"id":25684,"title":"American Ninja 5","poster":"https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg","overview":"When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.","release_date":"1993-01-01"}]'
# Headers
Content-Type: application/json
# Payload
[
{
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
"release_date": "1993-01-01"
}
]
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
{
"message": "The provided payload reached the size limit.",
"code": "payload_too_large",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#payload_too_large"
}
Add a list of documents or replace them if they already exist.
If you send an already existing document (same id) the whole existing document will be overwritten by the new document. Fields previously in the document not present in the new document are removed.
For a partial update of the document see Add or update documents route.
If the provided index does not exist, it will be created.
Use the reserved _geo
object to add geo coordinates to a document. _geo
is an object made of lat
and lng
field.
The content-type associated with the format to be indexed
Values are application/json
, text/csv
, or application/x-ndjson
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Payload Too Large
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/documents \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
{
"message": "The provided payload reached the size limit.",
"code": "payload_too_large",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#payload_too_large"
}
Delete all documents in the specified index.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid}/documents \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Delete a selection of documents based on array of document id's.
Payload content-type
Values are application/json
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/documents/delete-batch \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '[1,2,3,"a string id"]'
# Headers
Content-Type: application/json
# Payload
[
1,
2,
3,
"a string id"
]
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Get one document using its unique id.
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/documents/{documentId} \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
"release_date": "1993-01-01"
}
{
"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"
}
Delete one document based on its unique id.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid}/documents/{documentId} \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Search for documents matching a specific query in the given index.
This route should only be used when no API key is required. If an API key is required, use the POST route instead.
Query string.
Default value is ""
.
Comma-separated list of attributes whose fields will be present in the returned documents. Defaults to the displayedAttributes list which contains by default all attributes found in the documents.
Default value is *
.
Comma-separated list of attributes whose values will contain highlighted matching terms. Highlighted attributes are returned in _formatted
response object.
Specify the tag to put before the highlighted query terms.
Default value is <em>
.
Specify the tag to put after the highlighted query terms.
Default value is </em>
.
Comma-separated list of attributes whose values have to be cropped. Cropped attributes are returned in _formatted
response object.
Sets the crop marker to apply before and/or after cropped part selected within an attribute defined in attributesToCrop
parameter.
Default value is …
.
Sets the total number of words to keep around the matched part of an attribute specified in the attributesToCrop
parameter.
Default value is 10
.
Comma-separated list of attributes whose fields will be distributed as a facet. If you have set up filterableAttributes, you can retrieve the count of matching terms for each facets.Learn more about facet distribution in the dedicated guide
Attribute(s) to filter on.
Can be made of 3 syntaxes
["something > 1", "genres=comedy", ["genres=horror", "title=batman"]]
something > 1 AND genres=comedy AND (genres=horror OR title=batman)
["something > 1 AND genres=comedy", "genres=horror OR title=batman"]
_geoRadius({lat}, {lng}, {distance_in_meters}) built-in filter rule can be used to filter documents within a geo circle.
Attribute(s) used in filter
should be declared as filterable attributes. See Filtering and Faceted Search.
Number of documents to skip.
Default value is 0
.
Maximum number of documents to return.
Default value is 20
.
Defines whether an _matchesInfo
object that contains information about the matches should be returned or not.
Default value is false
.
Ok
Array of documents matching the search.
Only present if attributesToHighlight
/attributesToCrop
is not empty. Return highlighted and cropped fields.
Only present if matches = true
. Array of all search query occurrences in all fields.
Retrieve attributes of the document. attributesToRetrieve
controls these fields.
Using _geoPoint({lat}, {lng}) built-in sort rule at search leads the engine to return a _geoDistance within the search results. This field represents the distance in meters of the document from the specified _geoPoint.
Number of documents skipped.
Number of returned documents.
Total number of candidates for this search in the database.
Whether nbHits
is exhaustive.
Whether facetsDistribution
is exhaustive.
Processing time of the query.
Query originating the response.
Unauthorized
Not Found
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/search \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"hits": [
{
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
"release_date": "1993-01-01",
"_formatted": {
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.",
"release_date": "1993-01-01"
},
"_matchesInfo": {
"overview": [
{
"start": 49,
"length": 5
},
{
"start": 155,
"length": 5
}
]
}
}
],
"limit": 0,
"offset": 0,
"nbHits": 0,
"query": "string",
"exhaustiveNbHits": true,
"processingTimeMs": 0
}
{
"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"
}
Search for documents matching a specific query in the given index.
This is the preferred route to perform search when an API key is required, as it allows for preflight requests to be cached. Caching preflight requests improves considerably the speed of the search.
Payload content-type
Values are application/json
.
Query string.
Default value is ""
.
Array of attributes whose fields will be present in the returned documents. Defaults to the displayedAttributes list which contains by default all attributes found in the documents.
Default value is ["*"]
.
Array of attributes whose values will contain highlighted matching terms. Highlighted attributes are returned in _formatted
response object.
Default value is []
.
Specify the tag to put before the highlighted query terms.
Default value is <em>
.
Specify the tag to put after the highlighted query terms.
Default value is </em>
.
Array of attributes whose values have to be cropped. Cropped attributes are returned in _formatted
response object.
Default value is []
.
Sets the crop marker to apply before and/or after cropped part selected within an attribute defined in attributesToCrop
parameter.
Default value is …
.
Sets the total number of words to keep for the cropped part of an attribute specified in the attributesToCrop
parameter.
Default value is 10
.
Defines whether an _matchesInfo
object that contains information about the matches should be returned or not.
Default value is false
.
Attribute(s) to filter on.
Can be made of 3 syntaxes
["something > 1", "genres=comedy", ["genres=horror", "title=batman"]]
"something > 1 AND genres=comedy AND (genres=horror OR title=batman)"
["something > 1 AND genres=comedy", "genres=horror OR title=batman"]
_geoRadius({lat}, {lng}, {distance_in_meters}) built-in filter rule can be used to filter documents within a geo circle.
Attribute(s) used in filter
should be declared as filterable attributes. See Filtering and Faceted Search.
Array of attributes whose fields will be distributed as a facet. If you have set up filterableAttributes, you can retrieve the count of matching terms for each facets.Learn more about facet distribution in the dedicated guide
Default value is []
.
Number of documents to skip.
Default value is 0
.
Maximum number of documents returned.
Default value is 20
.
Ok
Array of documents matching the search.
Only present if attributesToHighlight
/attributesToCrop
is not empty. Return highlighted and cropped fields.
Only present if matches = true
. Array of all search query occurrences in all fields.
Retrieve attributes of the document. attributesToRetrieve
controls these fields.
Using _geoPoint({lat}, {lng}) built-in sort rule at search leads the engine to return a _geoDistance within the search results. This field represents the distance in meters of the document from the specified _geoPoint.
Number of documents skipped.
Number of returned documents.
Total number of candidates for this search in the database.
Whether nbHits
is exhaustive.
Whether facetsDistribution
is exhaustive.
Processing time of the query.
Query originating the response.
Unauthorized
Not Found
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/search \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"q":"Harry","offset":0,"limit":20,"filter":"(genres = Horror AND genres = Mystery) OR release_date \u003e 523242000","facetsDistribution":["genres","author"],"attributesToRetrieve":["title","overview"],"attributesToCrop":["overview"],"cropLength":20,"attributesToHighlight":["overview"],"matches":true}'
# Headers
Content-Type: application/json
# Payload
{
"q": "Harry",
"offset": 0,
"limit": 20,
"filter": "(genres = Horror AND genres = Mystery) OR release_date > 523242000",
"facetsDistribution": [
"genres",
"author"
],
"attributesToRetrieve": [
"title",
"overview"
],
"attributesToCrop": [
"overview"
],
"cropLength": 20,
"attributesToHighlight": [
"overview"
],
"matches": true
}
{
"hits": [
{
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American Ninja, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the ninja.",
"release_date": "1993-01-01",
"_formatted": {
"id": 25684,
"title": "American Ninja 5",
"poster": "https://image.tmdb.org/t/p/w1280/iuAQVI4mvjI83wnirpD8GVNRVuY.jpg",
"overview": "When a scientists daughter is kidnapped, American <em>Ninja</em>, attempts to find her, but this time he teams up with a youngster he has trained in the ways of the <em>ninja</em>.",
"release_date": "1993-01-01"
},
"_matchesInfo": {
"overview": [
{
"start": 49,
"length": 5
},
{
"start": 155,
"length": 5
}
]
}
}
],
"limit": 0,
"offset": 0,
"nbHits": 0,
"query": "string",
"exhaustiveNbHits": true,
"processingTimeMs": 0
}
{
"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"
}
Ok
List of ranking rules sorted by order of importance. The order is customizable.
Search returns documents with distinct (different) values of the given field.
Fields in which to search for matching query words sorted by order of importance.
Fields displayed in the returned documents.
List of words ignored when present in search queries.
List of associated words treated similarly. A word associated to an array of word as synonyms.
Attributes to use for facetting and filtering. See Filtering and Faceted Search.
List of attributes to sort on at search.
Customize typo tolerance feature.
Enable the typo tolerance feature.
Default value is true
.
Disable the typo tolerance feature on the specified attributes.
Default value is []
.
Disable the typo tolerance feature for a set of query terms given for a search query.
Default value is []
.
Unauthorized
Not Found
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/settings \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"rankingRules": [
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"release_date:asc"
],
"distinctAttribute": "ean13",
"searchableAttributes": [
"title",
"description",
"genre"
],
"displayedAttributes": [
"title",
"description",
"genre",
"release_date"
],
"stopWords": [
"of",
"the",
"to"
],
"synonyms": {
"wolverine": [
"xmen",
"logan"
],
"logan": [
"wolverine",
"xmen"
],
"wow": [
"world of warcraft"
]
},
"filterableAttributes": [
"genres",
"director"
],
"sortableAttributes": [
"price",
"author",
"title"
],
"typoTolerance": {
"enabled": true,
"disableOnAttributes": [
"author",
"price"
],
"disableOnWords": [
"Tolkien"
],
"minWordSizeForTypos": {
"oneTypo": 4,
"twoTypos": 8
}
}
}
{
"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"
}
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.
Payload content-type
Values are application/json
.
List of associated words treated similarly. A word associated to an array of word as synonyms.
List of words ignored when present in search queries.
List of ranking rules sorted by order of importance. The order is customizable.
Search returns documents with distinct (different) values of the given field.
Fields in which to search for matching query words sorted by order of importance.
Fields displayed in the returned documents.
Attributes to use for facetting and filtering. See Filtering and Faceted Search.
List of attributes to sort on at search.
Customize typo tolerance feature.
Enable the typo tolerance feature.
Default value is true
.
Disable the typo tolerance feature on the specified attributes.
Default value is []
.
Disable the typo tolerance feature for a set of query terms given for a search query.
Default value is []
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/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}}}'
# 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
}
}
}
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Reset the settings of an index.
All settings will be reset to their default value.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid}/settings \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/settings/synonyms \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"wolverine": [
"xmen",
"logan"
],
"logan": [
"wolverine",
"xmen"
],
"wow": [
"world of warcraft"
]
}
{
"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"
}
Update the list of synonyms of an index. Synonyms are normalized.
If the provided index does not exist, it will be created.
Payload content-type
Values are application/json
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/settings/synonyms \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"wolverine":["xmen","logan"],"logan":["wolverine","xmen"],"wow":["world of warcraft"]}'
# Headers
Content-Type: application/json
# Payload
{
"wolverine": [
"xmen",
"logan"
],
"logan": [
"wolverine",
"xmen"
],
"wow": [
"world of warcraft"
]
}
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Reset the list of synonyms of an index to its default value ({}
).
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid}/settings/synonyms \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Get the list of sortableAttributes of an index.
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/settings/sortable-attributes \
-H "Authorization: Bearer $ACCESS_TOKEN"
[
"price",
"author",
"title"
]
{
"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"
}
Update the list of sortableAttributes of an index.
In order to enable sorting capabilities on geographic data, the _geo
field must be added as a sortableAttribute.
Payload content-type
Values are application/json
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/settings/sortable-attributes \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '["price","author","title"]'
# Headers
Content-Type: application/json
# Payload
[
"price",
"author",
"title"
]
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Reset the list of sortableAttributes of an index to its default value ([]
).
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid}/settings/sortable-attributes \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/settings/stop-words \
-H "Authorization: Bearer $ACCESS_TOKEN"
[
"of",
"the",
"to"
]
{
"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"
}
Update the list of stop-words of an index.
If a list of stop-words already exists it will be overwritten (replaced).
If the provided index does not exist, it will be created.
Payload content-type
Values are application/json
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/settings/stop-words \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '["of","the","to"]'
# Headers
Content-Type: application/json
# Payload
[
"of",
"the",
"to"
]
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Reset the list of stop-words of an index to its default value ([]
).
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid}/settings/stop-words \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/settings/ranking-rules \
-H "Authorization: Bearer $ACCESS_TOKEN"
[
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"release_date:asc"
]
{
"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"
}
Update the ranking rules of an index.
To add your own ranking rule, you have to communicate either asc
for ascending order or desc
for descending order followed by the field name in brackets.
attribute_name:asc
attribute_name:desc
If the provided index does not exist, it will be created.
Payload content-type
Values are application/json
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/settings/ranking-rules \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '["words","typo","proximity","attribute","sort","exactness","release_date:asc"]'
# Headers
Content-Type: application/json
# Payload
[
"words",
"typo",
"proximity",
"attribute",
"sort",
"exactness",
"release_date:asc"
]
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Reset the ranking rules of an index to its default value.
Default Value:
["words", "typo", "proximity", "attribute", "sort", "exactness"]
To remove all ranking rules, which is not recommended in any case, you would send an empty array to the add or replace ranking rules route.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid}/settings/ranking-rules \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Get the typo tolerance configuration of an index.
Ok
Enable the typo tolerance feature.
Default value is true
.
Disable the typo tolerance feature on the specified attributes.
Default value is []
.
Disable the typo tolerance feature for a set of query terms given for a search query.
Default value is []
.
Unauthorized
Not Found
curl \
-X GET https://example.meilisearch.com:7700/indexes/{indexUid}/settings/typo-tolerance \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"enabled": true,
"disableOnAttributes": [],
"disableOnWords": [],
"minWordSizeForTypos": {
"oneTypo": 5,
"twoTypos": 9
}
}
{
"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"
}
Update the typo tolerance configuration of an index.
If the provided index does not exist, it will be created.
Payload content-type
Values are application/json
.
Enable the typo tolerance feature.
Default value is true
.
Disable the typo tolerance feature on the specified attributes.
Default value is []
.
Disable the typo tolerance feature for a set of query terms given for a search query.
Default value is []
.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X POST https://example.meilisearch.com:7700/indexes/{indexUid}/settings/typo-tolerance \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"disableOnAttributes":[],"disableOnWords":[],"minWordSizeForTypos":{"oneTypo":5,"twoTypos":9}}'
# Headers
Content-Type: application/json
# Payload
{
"enabled": true,
"disableOnAttributes": [],
"disableOnWords": [],
"minWordSizeForTypos": {
"oneTypo": 5,
"twoTypos": 9
}
}
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Reset the typo tolerance settings of an index to its default configuration.
Accepted
This uid
allows you to track the current task.
The unique identifier of the index where this task is operated
The status of the task
An RFC 3339
format for date/time/duration.
Unauthorized
Not Found
curl \
-X DELETE https://example.meilisearch.com:7700/indexes/{indexUid}/settings/typo-tolerance \
-H "Authorization: Bearer $ACCESS_TOKEN"
{
"uid": 0,
"indexUid": "movies",
"status": "enqueued",
"enqueuedAt": "2021-07-19T14:31:16.920473Z"
}
{
"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"
}
Get the filterable attributes of an index.