Skip to content

Commit e20888c

Browse files
Merge #1683
1683: add typo tolerance to Meilisearch 101 r=maryamsulemani97 a=maryamsulemani97 closes #1678 Co-authored-by: Maryam Sulemani <[email protected]> Co-authored-by: Maryam <[email protected]>
2 parents 150d660 + 2da6b13 commit e20888c

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

.code-samples.meilisearch.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,3 +951,10 @@ updating_guide_add_documents_old: |-
951951
-X POST 'http://localhost:7700/indexes/{index_uid}/documents' \
952952
-H 'Content-Type: application/json' -d @mydocuments.json \
953953
-H 'X-Meili-API-Key: API_KEY'
954+
getting_started_typo_tolerance: |-
955+
curl \
956+
-X POST 'http://localhost:7700/indexes/movies/settings/typo-tolerance' \
957+
-H 'Content-Type: application/json' \
958+
--data-binary '{
959+
"minWordSizeForTypos": { "oneTypo": 4 }
960+
}'

.vuepress/public/sample-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,4 @@ updating_guide_get_settings_old: |-
145145
updating_guide_retrieve_documents_old: |-
146146
updating_guide_update_settings_old: |-
147147
updating_guide_add_documents_old: |-
148+
getting_started_typo_tolerance: |-

learn/getting_started/customizing_relevancy.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ For example, if you search the `movies` index for `2012`, Meilisearch searches f
8989

9090
<CodeSamples id= "getting_started_update_searchable_attributes" />
9191

92-
Meilisearch will now only consider `title` during search and you will see fewer results.
92+
Meilisearch will now only consider `title` during search, and you will see fewer results.
9393

9494
::: note
9595

@@ -130,4 +130,23 @@ This will set `winnie` and `piglet` as synonyms; searching for either word will
130130

131131
You can read more about it in our [dedicated guide](/learn/configuration/synonyms.md).
132132

133-
The next chapter tackles more advanced topics including security and data backup.
133+
## Typo tolerance
134+
135+
Meilisearch is typo tolerant by default. It will help you find relevant search results even if you make spelling mistakes or typos, e.g., searching for `swaj` instead of `swan`.
136+
137+
The `typoTolerance` object allows you to:
138+
139+
- Enable or disable the typo tolerance feature
140+
- Configure the minimum word size for typos
141+
- Disable typos on specific words
142+
- Disable typos on specific attributes
143+
144+
Meilisearch accepts one typo for query terms containing `5` or more characters by default. If you search the movies index for `swaj`, you will not get any results.
145+
146+
<CodeSamples id= "getting_started_typo_tolerance" />
147+
148+
The above code sample sets the minimum word size for one typo to `4` characters. If you search for `swaj` now, you should get some results.
149+
150+
You can read more about typo tolerance in our [dedicated guide](/learn/configuration/typo_tolerance.md).
151+
152+
The next chapter tackles more advanced topics, including security and data backup.

0 commit comments

Comments
 (0)