🎉 Try the public beta of the new docs site at algolia.com/doc-beta! 🎉
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

The minimum number of characters in a query word before two typos are considered.

Changing this setting to a lower value than the default (8) can lead to many more matches, which might reduce relevance for short queries.

Examples# A

Set the default minimum character count to allow two typos#

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

Override the default minimum character count to allow two typos for the current search#

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