disablePrefixOnAttributes
[]
'disablePrefixOnAttributes' => [ 'attribute', ... ]
Can be used in these methods:
setSettings
set_settings
setSettings
set_settings
setSettings
setSettings
SetSettings
setSettings
SetSettings
setSettings
About this parameter
List of attributes for which you want to turn off prefix matching.
Use this parameter to ensure specific attributes, such as phone numbers and SKUs, only return exact matches.
Usage notes
searchableAttributesmust not be empty or null fordisablePrefixOnAttributesto be applied.- The list must be a subset of the
searchableAttributesindex setting. - Attribute names are case-sensitive.
While there’s no limit to the number of attributes, adding too many attributes can slow down calls to getSettings
and reduce the responsiveness of Algolia’s dashboard.
Examples
Disable prefix search for some attributes by default
1
2
3
4
5
$index->setSettings([
'disablePrefixOnAttributes' => [
'sku',
]
]);