How-to

How to configure Meilisearch typo tolerance for non-English content

by the AdminDex team 6 min read

Meilisearch's typo tolerance defaults are tuned for English: a word needs to be at least 5 characters long before one typo is allowed, and at least 9 characters before two typos are allowed. These thresholds are wrong for many other languages and for code-heavy or product-code content. Here's how to adjust them.

The default behaviour

Meilisearch ships these typo settings out of the box:

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

In plain English: a 4-letter word (e.g. "shoe") matches only exactly. A 5-letter word ("shoes") tolerates one typo ("shose"). A 9-letter word ("computers") tolerates two typos ("conpuetrs").

Why the defaults are wrong for some languages

Languages with shorter average word lengths

Indonesian, Malay, Vietnamese, and several other languages have shorter average word lengths than English. A 5-character minimum means typo tolerance is essentially disabled for half the vocabulary. Lower the threshold to 3 or 4.

Languages with non-Latin scripts

For Arabic, Hebrew, Japanese, Chinese, Korean, and Thai, the concept of "characters" gets fuzzy. Each grapheme cluster might be a single user-perceived character but multiple Unicode code points. Test the defaults with real user queries before assuming they work.

Compound-word languages

German, Dutch, and Finnish form long compound words (e.g. "Donaudampfschifffahrtsgesellschaft"). A 9-character threshold for two typos works for these. The 5-character threshold for one typo is fine.

How to lower the thresholds

PATCH /indexes/{uid}/settings/typo-tolerance
{
  "minWordSizeForTypos": {
    "oneTypo": 3,
    "twoTypos": 7
  }
}

Common configurations by content type:

Content typeoneTypotwoTypos
English prose (default)59
Short-word languages (Indonesian, Malay)37
Compound-word languages (German, Finnish)59
Mixed-language sites48

Disabling typo tolerance on specific words

Sometimes you need typo tolerance generally but want it off for a few words that produce nonsense matches. Common examples: brand names, product codes, version numbers.

PATCH /indexes/{uid}/settings/typo-tolerance
{
  "disableOnWords": ["nginx", "v1.10", "k8s"]
}

A search for "nginx" will now require an exact match — no false positives from "nginz" or "ngixn".

Disabling typo tolerance on specific attributes

If you have an attribute that should always match exactly — SKU codes, ISBN numbers, email addresses, phone numbers — disable typo tolerance for the whole attribute:

PATCH /indexes/{uid}/settings/typo-tolerance
{
  "disableOnAttributes": ["sku", "isbn", "phone"]
}

This is almost always the right call for any field containing structured codes. A typo in a SKU is a different SKU, not a misspelling.

Disabling typo tolerance entirely

For code search, log search, or any content where exact matching is the whole point:

PATCH /indexes/{uid}/settings/typo-tolerance
{
  "enabled": false
}

This is a sledgehammer. Use it sparingly — most user-facing search benefits from typo tolerance for at least some content.

How typo count maps to behaviour

Meilisearch supports up to two typos per word. A "typo" is one of:

  • Substitution (one letter changed: "running" → "runninf")
  • Insertion (one extra letter: "running" → "runninng")
  • Deletion (one missing letter: "running" → "runing")
  • Transposition (two adjacent letters swapped: "running" → "runnnig")

This is the standard Damerau-Levenshtein distance. Two typos means any combination of two of the above edits.

Testing your configuration

After changing typo tolerance settings, test with the queries your users actually run:

  1. Pull a sample of real queries from your search logs (or synthesize representative ones).
  2. For each query, run it before and after the change and compare the top 10 results.
  3. Watch your zero-result rate — if it goes up significantly after tightening typo tolerance, you've gone too far.

FAQ

Does typo tolerance affect performance?

Slightly. Each enabled typo level adds a small lookup cost per query. The impact is rarely measurable on indexes under 10M documents — sub-millisecond.

Can I have different typo settings for different attributes?

Partially — you can disable typo tolerance per-attribute via disableOnAttributes, but you can't have different minWordSizeForTypos thresholds per attribute. Settings are index-level.

Does typo tolerance work with prefix matching?

Yes. Meilisearch combines prefix matching and typo tolerance — a query for "runn" will match "running" via prefix, and a query for "rnun" will match "running" via prefix + transposition. Both happen by default.

Can AdminDex help configure typo tolerance?

Yes — AdminDex's settings editor exposes the typo tolerance fields with inline help drawers explaining each one and what defaults to use for which language. No JSON editing required.

Stop running Meilisearch from a terminal.

AdminDex gives you a visual dashboard for every Meilisearch instance you own — settings, API keys, tasks, and search analytics.

Connect your first instance

Related reading