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

Can be used in these methods:
search, setSettings, browseObjects, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey

About this parameter# A

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# A

Set default min word size to allow 2 typo#

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

Override default min word size to allow 2 typo for the current search#

1
2
3
$results = $index->search('query', [
  'minWordSizefor2Typos' => 2
]);
Did you find this page helpful?
PHP v3