API Reference / API Parameters / minWordSizefor2Typos
Type: integer
Engine default: 8
Formerly: minWordSizeForApprox2
Parameter syntax
'minWordSizefor2Typos' => min_word_size

Can be used in these methods:

About this parameter

Minimum number of characters a word in the query string must contain to accept matches with 2 typos.

Changing this setting to a lower number can negatively affect relevance with short queries, because more records will be considered a match with two typos.

Examples

Set default min word size to allow 2 typo

1
2
3
$index->setSettings([
  'minWordSizefor2Typos' => 4
]);
1
2
3
$results = $index->search('query', [
  'minWordSizefor2Typos' => 2
]);

Did you find this page helpful?