# Typo tolerance

Child route of the settings route.

This route allows you to configure the typo tolerance settings for an index.

Typo tolerance settings can also be updated directly through the global settings route along with the other settings.

To learn more about typo tolerance, refer to our dedicated guide.

WARNING

Updating the settings means overwriting the default settings of Meilisearch. You can reset to default values using the DELETE routes.

# Get typo tolerance

GET
/indexes/{index_uid}/settings/typo-tolerance

Get the typo tolerance settings of an index. The index uid is required.

# Example

curl \
  -X GET 'http://localhost:7700/indexes/books/settings/typo-tolerance'

# Response: 200 OK

{
  "enabled": true,
  "minWordSizeForTypos": {
    "oneTypo": 5,
    "twoTypos": 9
  },
  "disableOnWords": [],
  "disableOnAttributes": []
}

# Returned fields

# enabled

Whether typo tolerance is enabled or not.

# minWordSizeForTypos

The minimum word length for tolerating 1 or 2 typos.

Name Description
oneTypo The minimum word size for tolerating 1 typo
twoTypos The minimum word size for tolerating 2 typos

# disableOnWords

An array of words for which the typo tolerance feature is disabled.

# disableOnAttributes

An array of attributes for which the typo tolerance feature is disabled.

# Update typo tolerance

POST
/indexes/{index_uid}/settings/typo-tolerance

Partially update the typo tolerance settings for an index. The index uid is required.

# Body

# enabled

Type: boolean
Default value: true

Whether typo tolerance is enabled or not.

# minWordSizeForTypos

Type: object

Customize the minimum word length for accepting 1 or 2 typos.

Name Description Type Default value
oneTypo The minimum word size for accepting 1 typo; must be between 0 and twoTypos integer 5
twoTypos The minimum word size for accepting 2 typos; must be between oneTypo and 255 integer 9

# disableOnWords

Type: array
Default value: []

An array of words for which the typo tolerance feature is disabled.

# disableOnAttributes

Type: array
Default value: []

An array of attributes for which the typo tolerance feature is disabled.

# Example

curl \
  -X POST 'http://localhost:7700/indexes/books/settings/typo-tolerance' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "minWordSizeForTypos": {
      "oneTypo": 4,
      "twoTypos": 10
    },
    "disableOnAttributes": [
      "title"
    ]
  }'

# Response: 200 OK

{
    "uid": 1,
    "indexUid": "books",
    "status": "enqueued",
    "type": "settingsUpdate",
    "enqueuedAt": "2022-04-14T20:56:44.991039Z"
}

You can use the returned uid to get more details on the status of the task.

# Reset typo tolerance

Reset an index's typo tolerance settings to their default value. The index uid is required.

# Example

curl \
  -X DELETE 'http://localhost:7700/indexes/books/settings/typo-tolerance'

# Response: 200 OK

{
    "uid": 1,
    "indexUid": "books",
    "status": "enqueued",
    "type": "settingsUpdate",
    "enqueuedAt": "2022-04-14T20:53:32.863107Z"
}

You can use the returned uid to get more details on the status of the task.