Skip to main content
PATCH
/
indexes
/
{indexUid}
/
settings
/
typo-tolerance
cURL
curl \
  -X PATCH 'MEILISEARCH_URL/indexes/books/settings/typo-tolerance' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "minWordSizeForTypos": {
      "oneTypo": 4,
      "twoTypos": 10
    },
    "disableOnAttributes": ["title"]
  }'
{
  "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

Configuration for typo tolerance in search queries.

Typo tolerance allows Meilisearch to match documents even when search terms contain spelling mistakes.

enabled
boolean | null

When true, enables typo tolerance for search queries. When false, only exact matches are returned. Defaults to true.

Example:

true

minWordSizeForTypos
object

Configures the minimum word length before typos are allowed. Contains oneTypo (min length for 1 typo) and twoTypos (min length for 2 typos) settings.

disableOnWords
string[] | null

A list of words for which typo tolerance should be disabled. Use this for brand names, technical terms, or other words that must be matched exactly. Example: ["iPhone", "macOS"].

Example:
["iPhone", "phone"]
disableOnAttributes
string[] | null

A list of attributes for which typo tolerance should be disabled. Searches in these attributes will only return exact matches. Useful for fields like product codes or IDs.

Example:
["uuid", "url"]
disableOnNumbers
boolean | null

When true, disables typo tolerance on numeric tokens. This prevents numbers like 123 from matching 132. Defaults to false.

Example:

true

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.