API Reference / API Parameters / allowTyposOnNumericTokens
Type: boolean
Engine default: true
Parameter syntax
'allowTyposOnNumericTokens' => true|false

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

About this parameter# A

Whether to allow typos on numbers (“numeric tokens”) in the query string.

This option can be very useful on numbers with special formatting, like serial numbers and zip codes searches.

Usage notes:#

  • When false, typo tolerance is disabled on numeric tokens. For example, the query 304 will match 30450 but not 40450 (which would have been the case with typo tolerance enabled).

Examples# A

Disable typos on numeric tokens by default#

1
2
3
$index->setSettings([
  'allowTyposOnNumericTokens' => false
]);

Disable typos on numeric tokens for the current search#

1
2
3
$results = $index->search('query', [
  'allowTyposOnNumericTokens' => false
]);

Did you find this page helpful?

PHP v3