Approximation Vs Spell Check
Approximation is similar to spell check. The difference is that approximation only applies
to the word that follows the prefix handler with which it is associated (myprefix:
word
). Meanwhile, spell check applies to the entire user query and has more
configuration options.
The approximation module considers both the word length and the number of transformations allowed to expand the original query with additional words. Transformations mean that you replace (substitute) a letter, add a letter, transpose a letter, or delete a letter.
The approximation module searches for words that are at transformation distance 1 or 2 of
the original word from the user’s query. Distances are hard-coded, so you can only control
the word length that triggers distance 1 or distance 2. In other words, depending on the
word length, you set either max_distance=0
, 1
or
2
.
See also Adding 'Did You Mean?' Spell-Check.