Updates one or more settings for the index. Only the fields sent in the body are changed. Pass null for a setting to reset it to its default. If the index does not exist, it is created.
See also: Configuring index settings on the Cloud.
An API key is a token that you provide when making API calls. Read more about how to secure your project.
Include the API key to the Authorization header, for instance:
-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:
const client = new MeiliSearch({
host: 'MEILISEARCH_URL',
apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1'
});Unique identifier of the index.
Index settings: every option you can configure for search and index behavior.
Used as the request body for PATCH settings. Only the fields you send are updated; pass null to reset a setting to its default.
See also: Configuring index settings on the Cloud.
Fields returned in search results. Affects only search endpoints, not get-document endpoints. See displayed and searchable attributes.
["id", "title", "description", "url"]Fields searched for query words, in order of importance. Defines attribute ranking order. See displayed and searchable attributes.
["title", "description"]Foreign keys to use for cross-index filtering search.
[
{
"foreignIndexUid": "products",
"fieldName": "productId"
}
]Ranking rules in order of importance. Built-in rules and custom sort rules (attribute:asc or attribute:desc).
[
"words",
"typo",
"proximity",
"attributeRank",
"sort",
"wordPosition",
"exactness"
]Words ignored when present in search queries.
["the", "a"]Characters that are not treated as word separators. Removed from the default separator set.
["@", "#"]Characters that delimit words. Added on top of the default separators.
["|"]Strings Meilisearch parses as a single term. Useful for names or domain terms.
["J. R. R."]Field whose value must be unique in the returned documents. One document per distinct value. See distinct attribute.
"sku"
Precision for the proximity ranking rule and phrase search: byWord (exact distance) or byAttribute (same attribute).
"byWord"
Typo tolerance: enable/disable, minimum word length for typos, and where to disable it.
Related to pagination: maximum number of results a search can return.
Embedders used for semantic and hybrid search. Map of embedder name to config (source, model, documentTemplate, etc.).
{
"default": {
"source": "openAi",
"model": "text-embedding-3-small",
"documentTemplate": "{{doc.title}}: {{doc.overview}}"
}
}Maximum duration of a search in milliseconds. If reached, the search stops and returns results computed so far. When null, 1500 ms is used.
x >= 01500
Locales and attribute patterns for language-specific tokenization. Affects searchable, filterable, and sortable attributes.
[
{
"locales": ["jpn"],
"attributePatterns": ["*_ja"]
}
]When true, facet search is enabled. When false, the facet-search endpoint is disabled.
true
When to compute prefix matches: indexingTime or disabled. disabled speeds up indexing but reduces relevancy.
indexingTime, disabled Chat (conversation) settings: index description, document template, and search parameters used when the LLM queries this index.
Task successfully enqueued.
A summarized view of a task, returned when a task is enqueued
Unique sequential identifier of the task.
x >= 0Status of the task. Possible values are enqueued, processing,
succeeded, failed, and canceled.
enqueued, processing, succeeded, failed, canceled "processing"
Type of operation performed by the task.
documentAdditionOrUpdate, documentEdition, documentDeletion, settingsUpdate, indexCreation, indexDeletion, indexUpdate, indexSwap, taskCancelation, taskDeletion, dumpCreation, snapshotCreation, export, upgradeDatabase, indexCompaction, networkTopologyChange "documentAdditionOrUpdate"
Date and time when the task was enqueued.
Unique identifier of the targeted index. Null for global tasks.
Custom metadata attached to this task at creation. Use it to associate tasks with external systems or add application-specific information.