API Reference / API Parameters / disableTypoToleranceOnAttributes

disableTypoToleranceOnAttributes

Type: list of strings
Engine default: []
Formerly: disableTypoToleranceOn
Parameter syntax
'disableTypoToleranceOnAttributes' => [
  'attribute',
  ...
]

Can be used in these methods:

About this parameter

List of attributes on which you want to disable typo tolerance.

Usage notes

  • The list must be a subset of the searchableAttributes index setting.

  • searchableAttributes must not be empty nor null for disableTypoToleranceOnAttributes to be applied.

Examples

Disable typo tolerance for some attributes by default

1
2
3
4
5
$index->setSettings([
  'disableTypoToleranceOnAttributes' => [
    'sku',
  ]
]);
1
2
3
4
5
$results = $index->search('query', [
  'disableTypoToleranceOnAttributes' => [
    'sku'
  ]
]);
Did you find this page helpful?