Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/articles/how-fuzzy-search-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ When you search for "javscript" and Fuse.js returns "JavaScript", it's using **a

The core idea is **edit distance**: the minimum number of single-character operations (insertions, deletions, substitutions) needed to transform one string into another.

For example, turning "javscript" into "javascript" requires:
For a three-edit example, turning "jovscript" into "javascripts" requires:

- **Substitute** `o` → `a` (at position 2)
- **Insert** `a` (at position 4)
- **Insert** `s` (at position 10)
- **Substitute** `o` with `a`: `jovscript` → `javscript`
- **Insert** `a` after `v`: `javscript` → `javascript`
- **Insert** `s` at the end: `javascript` → `javascripts`

That's an edit distance of 3. The lower the distance relative to the string length, the better the match.

Expand Down