allowTyposOnNumericTokens
true
'allowTyposOnNumericTokens' => true|false
Can be used in these methods:
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
set_settings,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
set_settings,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
setSettings,
browse,
searchForFacetValues,
generateSecuredApiKey,
addAPIKey,
updateAPIKey
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
SetSettings,
Browse,
SearchForFacetValues,
GenerateSecuredApiKey,
AddApiKey,
UpdateApiKey
Search,
setSettings,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
SetSettings,
BrowseObjects,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
setSettings,
browse index,
search into facet values,
generateSecuredApiKey,
add key,
update key
About this parameter
Whether to allow numeric typos in the query.
- Enable numeric typo tolerance to help broaden your search and help users find numbers in a query even if they don’t remember every digit.
- Turn numeric typo tolerance off if you only want users to find matches for the exact number they entered. This can help reduce false negative results when searching for things like zip codes or similar number sequences.
For example, if a user searches for “304”:
allowTyposOnNumericTokens |
User finds |
---|---|
On (true ) |
304, 404, 340 |
Off (`false’) | 304 |
Examples
Disable typos on numbers by default
1
2
3
$index->setSettings([
'allowTyposOnNumericTokens' => false
]);
Disable typos on numbers for the current search
1
2
3
$results = $index->search('query', [
'allowTyposOnNumericTokens' => false
]);