Skip to main content
Search engines need to handle user typos gracefully. Two common approaches exist: typo tolerance (used by Meilisearch) and fuzzy search (used by Elasticsearch, Typesense, and others). While both aim to return relevant results despite misspellings, they differ in how they work and how much configuration they require.

How Meilisearch handles typos

Meilisearch uses a typo tolerance system based on Damerau-Levenshtein edit distance. An edit distance counts the minimum number of single-character operations (insertions, deletions, substitutions, or transpositions) needed to transform one word into another. For example, “galaxy” and “galxy” have an edit distance of 1 (one deletion), while “galaxy” and “gelxay” have an edit distance of 2.

Automatic word-length thresholds

Meilisearch applies typo tolerance automatically based on word length:
Word lengthAllowed typos
1-4 characters0 typos
5-8 characters1 typo
9+ characters2 typos
This means short words like “the” or “cat” must match exactly, while longer words like “adventure” (9 characters) tolerate up to 2 typos. These thresholds are configurable through the typo tolerance settings.

Key characteristics

  • Enabled by default: No setup required. Typo tolerance works out of the box on every index.
  • Per-word-length tuning: The number of allowed typos scales with word length, reducing false positives on short words.
  • Maximum of 2 typos: Meilisearch allows at most 2 typos per word, regardless of word length. This keeps results relevant without returning too many unrelated matches.
  • Ranking integration: Documents with fewer typos rank higher than documents with more typos, thanks to the built-in typo ranking rule.
  • Disabling per attribute or word: You can disable typo tolerance on specific attributes or for specific words using the typo tolerance settings API.

How fuzzy search works in other engines

Fuzzy search is a broader term that covers several techniques for approximate string matching. In engines like Elasticsearch, fuzzy search typically uses edit distance as well, but requires explicit configuration.

Common fuzzy search approaches

  • Edit distance with manual fuzziness: Elasticsearch’s fuzziness parameter lets you set the maximum edit distance per query or field. You can use AUTO mode, which applies length-based thresholds similar to Meilisearch, but this must be opted into explicitly.
  • N-gram based matching: Some engines break words into overlapping character sequences (n-grams) and match documents that share enough n-grams with the query. This can catch typos but also produces more false positives.
  • Phonetic matching: Algorithms like Soundex or Metaphone match words that sound similar, regardless of spelling. This helps with phonetic misspellings but does not handle transpositions or insertions well.

Key characteristics

  • Opt-in configuration: Fuzzy search is typically disabled by default and must be enabled per field or per query.
  • Manual tuning required: You choose the fuzziness level, decide which fields support fuzzy matching, and configure analyzers or tokenizers accordingly.
  • Flexible but complex: Engines like Elasticsearch offer fine-grained control over fuzziness, prefix length, max expansions, and transposition handling, but this flexibility comes with a steeper learning curve.

Side-by-side comparison

Meilisearch (typo tolerance)Typical fuzzy search
Enabled by defaultYesNo (opt-in)
Configuration requiredNone for basic useFuzziness level, fields, analyzers
AlgorithmDamerau-LevenshteinVaries (edit distance, n-grams, phonetic)
Max typos2Configurable (often 0-2)
Word-length awarenessBuilt-in thresholdsAvailable in some engines (e.g., Elasticsearch AUTO)
Ranking impactFewer typos rank higher automaticallyDepends on scoring configuration
Per-attribute controlYes (disable on specific attributes)Yes (configure per field)
Per-word controlYes (disable for specific words)Limited

When each approach works best

Meilisearch typo tolerance

  • You want typo handling that works immediately without configuration
  • Your application targets end users who expect instant, forgiving search (e-commerce, media, SaaS)
  • You prefer sensible defaults over manual tuning
  • You need granular control over fuzziness per field or per query
  • Your use case requires matching strategies beyond edit distance (phonetic, n-gram)
  • You have dedicated search engineers who can tune and maintain the configuration

Further reading

Typo tolerance settings

Configure typo tolerance thresholds and exceptions in Meilisearch

Ranking rules

Learn how the typo ranking rule affects result ordering

Meilisearch vs Elasticsearch

Full comparison between Meilisearch and Elasticsearch

Meilisearch vs Typesense

Full comparison between Meilisearch and Typesense