Typo tolerance `minWordSizeForTypos` settings have no effect on search results
Describe the bug
Configuring typoTolerance.minWordSizeForTypos to restrictive values has no observable effect on search results. A 4-character query that should be filtered out by the restrictive settings (requiring 10+ chars for one typo) still returns the same matches as with default settings, indicating the typo tolerance configuration is silently ignored.
To Reproduce
Steps to reproduce the behavior:
- Create an index and add documents with similar words:
curl -X POST 'http://localhost:7700/indexes' \
-H 'Content-Type: application/json' \
--data '{"uid": "typo-test", "primaryKey": "id"}'
# Wait for task to complete, then add documents
curl -X POST 'http://localhost:7700/indexes/typo-test/documents' \
-H 'Content-Type: application/json' \
--data '[
{"id": 1, "title": "apple pie recipe"},
{"id": 2, "title": "application framework"},
{"id": 3, "title": "appliance repair"}
]'
# Wait for task to complete
- Search with query
"appl"(4 chars) using default typo tolerance — returns 3 hits via prefix/typo matching:
curl -X POST 'http://localhost:7700/indexes/typo-test/search' \
-H 'Content-Type: application/json' \
--data '{"q": "appl"}'
Response (3 hits):
{"hits":[{"id":1,"title":"apple pie recipe"},{"id":2,"title":"application framework"},{"id":3,"title":"appliance repair"}],"estimatedTotalHits":3}
- Set restrictive typo tolerance —
oneTypo=10means words must be at least 10 chars to get any typo correction:
curl -X PATCH 'http://localhost:7700/indexes/typo-test/settings' \
-H 'Content-Type: application/json' \
--data '{
"typoTolerance": {
"enabled": true,
"minWordSizeForTypos": {"oneTypo": 10, "twoTypos": 20}
}
}'
# Wait for settings update task to complete (status=succeeded)
- Search again with the same query
"appl"— identical results, typo tolerance settings had no effect:
curl -X POST 'http://localhost:7700/indexes/typo-test/search' \
-H 'Content-Type: application/json' \
--data '{"q": "appl"}'
Response (same 3 hits):
{"hits":[{"id":1,"title":"apple pie recipe"},{"id":2,"title":"application framework"},{"id":3,"title":"appliance repair"}],"estimatedTotalHits":3}
Expected behavior
With minWordSizeForTypos.oneTypo=10, a 4-character query "appl" should not trigger typo correction for the word "apple" (which differs by 1 typo but is only 5 chars, well below the 10-char threshold). The search results should differ from the default configuration — at minimum, "apple pie recipe" should not match "appl" via typo tolerance.
Per the typo tolerance documentation, minWordSizeForTypos controls the minimum word length required before typo correction is applied:
By default, Meilisearch accepts one typo for query terms containing five or more characters, and up to two typos if the term is at least nine characters long. You can override these default settings using the
minWordSizeForTyposobject.
Setting oneTypo=10 should prevent typo correction on query words shorter than 10 characters. Since "appl" is only 4 characters, it should not receive any typo correction and thus should not match "apple" via a typo.
Meilisearch version
v1.48.3
Additional context
- The settings PATCH task completes successfully (task status
succeeded), confirming the configuration was accepted by the server - The issue is not specific to the
/settingsendpoint — using/settings/typo-toleranceproduces the same result - Running in development mode (
MEILI_ENV=development, no master key) - Docker image:
getmeili/meilisearch:v1.48.3
Source: meilisearch/meilisearch