Skip to main content
PATCH
/
indexes
/
{indexUid}
/
settings
cURL
curl \
  -X PATCH 'MEILISEARCH_URL/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
    },
    "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

indexUid
string
required

Unique identifier of the index.

Body

application/json

Holds all the settings for an index. T can either be Checked if they represents settings whose validity is guaranteed, or Unchecked if they need to be validated. In the later case, a call to check will return a Settings<Checked> from a Settings<Unchecked>.

displayedAttributes
string[] | null

Fields displayed in the returned documents.

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

Fields in which to search for matching query words sorted by order of importance.

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

Attributes to use for faceting and filtering. See Filtering and Faceted Search.

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

Attributes to use when sorting search results.

Example:
["release_date"]
rankingRules
string[] | null

List of ranking rules sorted by order of importance. The order is customizable. A list of ordered built-in ranking rules.

Example:
[
"words",
"typo",
"proximity",
"attribute",
"exactness"
]
stopWords
string[] | null

List of words ignored when present in search queries.

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

List of characters not delimiting where one term begins and ends.

Example:
[" ", "\n"]
separatorTokens
string[] | null

List of characters delimiting where one term begins and ends.

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

List of strings Meilisearch should parse as a single term.

Example:
["iPhone pro"]
synonyms
object

List of associated words treated similarly. A word associated to an array of word as synonyms.

Example:
{
"he": ["she", "they", "them"],
"phone": ["iPhone", "android"]
}
distinctAttribute
string | null

Search returns documents with distinct (different) values of the given field.

Example:

"sku"

proximityPrecision
string | null

Precision level when calculating the proximity ranking rule.

Example:

"byAttribute"

typoTolerance
object

Typo tolerance settings for controlling how Meilisearch handles spelling mistakes in search queries. Configure minimum word lengths, disable on specific words or attributes.

faceting
object

Faceting settings for controlling facet behavior. Configure maximum facet values returned and sorting order for facet values.

pagination
object

Pagination settings for controlling the maximum number of results that can be returned. Set maxTotalHits to limit how far users can paginate into results.

embedders
object

Embedder required for performing semantic search queries.

searchCutoffMs
integer<u-int64> | null

Maximum duration of a search query.

Required range: x >= 0
Example:

50

localizedAttributes
object[] | null

Rules for associating locales (languages) with specific attributes. This enables language-specific tokenization for multilingual content, improving search quality for non-English text.

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

When true, enables facet search which allows users to search within facet values. When false, only the first maxValuesPerFacet values are returned. Defaults to true.

Example:

true

prefixSearch
null | enum<string>

Controls prefix search behavior. indexingTime enables prefix search by building a prefix database at indexing time. disabled turns off prefix search for faster indexing. Defaults to indexingTime.

Available options:
indexingTime,
disabled
chat
object

Chat settings for AI-powered search. Configure the index description, document template for rendering, and search parameters used when the LLM queries this index.

vectorStore
null | enum<string>

Backend storage for vector embeddings. memory stores vectors in memory for fastest performance. database stores vectors on disk to reduce memory usage at the cost of speed.

Available options:
stable,
experimental

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.