Skip to main content
PATCH
/
indexes
/
{index_uid}
/
settings
cURL
curl \
  -X PATCH 'MEILISEARCH_URL/indexes/movies/settings' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "rankingRules": [
      "words",
      "typo",
      "proximity",
      "attributeRank",
      "sort",
      "wordPosition",
      "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
    },
    "searchCutoffMs": 150
  }'
{
  "taskUid": 147,
  "indexUid": "movies",
  "status": "enqueued",
  "type": "settingsUpdate",
  "enqueuedAt": "2024-08-08T17:05:55.791772Z"
}

Authorizations

Authorization
string
header
required

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'
});

Path Parameters

index_uid
string
required

Unique identifier of the index.

Body

application/json

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.

displayedAttributes
string[] | null

Fields returned in search results. Affects only search endpoints, not get-document endpoints. See displayed and searchable attributes.

Example:
["id", "title", "description", "url"]
searchableAttributes
string[] | null

Fields searched for query words, in order of importance. Defines attribute ranking order. See displayed and searchable attributes.

Example:
["title", "description"]
filterableAttributes
(string | object)[] | null

Attributes that can be used as filters and facets. Strings or objects with attributePatterns and features.

Example:
["release_date", "genre"]
sortableAttributes
string[] | null

Attributes that can be used to sort search results.

Example:
["release_date"]
foreignKeys
object[] | null

Foreign keys to use for cross-index filtering search.

Example:
[
{
"foreignIndexUid": "products",
"fieldName": "productId"
}
]
rankingRules
string[] | null

Ranking rules in order of importance. Built-in rules and custom sort rules (attribute:asc or attribute:desc).

Example:
[
"words",
"typo",
"proximity",
"attributeRank",
"sort",
"wordPosition",
"exactness"
]
stopWords
string[] | null

Words ignored when present in search queries.

Example:
["the", "a"]
nonSeparatorTokens
string[] | null

Characters that are not treated as word separators. Removed from the default separator set.

Example:
["@", "#"]
separatorTokens
string[] | null

Characters that delimit words. Added on top of the default separators.

Example:
["|"]
dictionary
string[] | null

Strings Meilisearch parses as a single term. Useful for names or domain terms.

Example:
["J. R. R."]
synonyms
object

Pairs of words or phrases treated as equivalent for search. Key maps to an array of synonyms.

Example:
{ "phone": ["iPhone"] }
distinctAttribute
string | null

Field whose value must be unique in the returned documents. One document per distinct value. See distinct attribute.

Example:

"sku"

proximityPrecision
string | null
default:byWord

Precision for the proximity ranking rule and phrase search: byWord (exact distance) or byAttribute (same attribute).

Example:

"byWord"

typoTolerance
object

Typo tolerance: enable/disable, minimum word length for typos, and where to disable it.

faceting
object

Related to faceting: max facet values per facet and how facet values are sorted.

pagination
object

Related to pagination: maximum number of results a search can return.

embedders
object

Embedders used for semantic and hybrid search. Map of embedder name to config (source, model, documentTemplate, etc.).

Example:
{
"default": {
"source": "openAi",
"model": "text-embedding-3-small",
"documentTemplate": "{{doc.title}}: {{doc.overview}}"
}
}
searchCutoffMs
integer<u-int64> | null

Maximum duration of a search in milliseconds. If reached, the search stops and returns results computed so far. When null, 1500 ms is used.

Required range: x >= 0
Example:

1500

localizedAttributes
object[] | null

Locales and attribute patterns for language-specific tokenization. Affects searchable, filterable, and sortable attributes.

Example:
[
{
"locales": ["jpn"],
"attributePatterns": ["*_ja"]
}
]
facetSearch
boolean | null
default:true

When true, facet search is enabled. When false, the facet-search endpoint is disabled.

Example:

true

prefixSearch
null | enum<string>
default:indexingTime

When to compute prefix matches: indexingTime or disabled. disabled speeds up indexing but reduces relevancy.

Available options:
indexingTime,
disabled
chat
object

Chat (conversation) settings: index description, document template, and search parameters used when the LLM queries this index.

Response

Task successfully enqueued.

A summarized view of a task, returned when a task is enqueued

taskUid
integer<u-int32>
required

Unique sequential identifier of the task.

Required range: x >= 0
status
enum<string>
required

Status of the task. Possible values are enqueued, processing, succeeded, failed, and canceled.

Available options:
enqueued,
processing,
succeeded,
failed,
canceled
Example:

"processing"

type
enum<string>
required

Type of operation performed by the task.

Available options:
documentAdditionOrUpdate,
documentEdition,
documentDeletion,
settingsUpdate,
indexCreation,
indexDeletion,
indexUpdate,
indexSwap,
taskCancelation,
taskDeletion,
dumpCreation,
snapshotCreation,
export,
upgradeDatabase,
indexCompaction,
networkTopologyChange
Example:

"documentAdditionOrUpdate"

enqueuedAt
string<date-time>
required

Date and time when the task was enqueued.

indexUid
string | null

Unique identifier of the targeted index. Null for global tasks.

customMetadata
string | null

Custom metadata attached to this task at creation. Use it to associate tasks with external systems or add application-specific information.