🎉 Try the public beta of the new docs site at algolia.com/doc-beta! 🎉
API Reference / API Parameters / disableExactOnAttributes
Type: list of strings
Engine default: []
Parameter syntax
'disableExactOnAttributes' => [
  'attribute',
  ...
]

Can be used in these methods:

About this parameter

List of attributes for which you want to turn off the exact ranking criterion.

Because the engine’s exact ranking criterion finds variations of the search terms, users might get too many irrelevant results when searching in long attributes like product descriptions.

Enabling `disableExactOnAttributes:

  • Prioritizes exact matches in longer attributes
  • Reduces the number of false positives
  • Doesn’t reduce relevance for other attributes.

On the other hand, when searching for something precise, like keywords, it’s usually better not to enable this parameter. This is because exact matches are more likely between queries and these attributes.

Usage notes

There’s no limit to the number of attributes in the list, but having many attributes slows down calls to getSettings. This can make the Algolia dashboard slower and less responsive.

Examples

Turn off the exact ranking criterion for some attributes by default

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