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
searchableAttributes
must not be empty or null fordisablePrefixOnAttributes
to be applied.- The list must be a subset of the
searchableAttributes
index setting.
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
Disable prefix search for some attributes by default
1
2
3
4
5
$index->setSettings([
'disablePrefixOnAttributes' => [
'sku',
]
]);