Expand description
Fuzzy string matching via Levenshtein edit distance.
Used for typo-tolerant full-text search. When an exact term match isn’t found in the inverted index, fuzzy matching finds terms within a configurable edit distance.
Distance thresholds are adaptive based on token length:
- 1-3 chars: exact only (no fuzzy — too many false positives)
- 4-6 chars: max distance 1
- 7+ chars: max distance 2
Functions§
- fuzzy_
discount - Score discount for fuzzy matches based on edit distance.
- fuzzy_
match - Find terms in the index that fuzzy-match the query term.
- levenshtein
- Compute Levenshtein edit distance between two strings.
- max_
distance_ for_ length - Maximum allowed edit distance for a given token length.