disablePrefixOnAttributes parameter turns off prefix matching for the specified attributes.
This is useful when you want to ensure only full-word matches are allowed—for example,
in attributes like SKUs, phone numbers, or serial codes—where partial matches could produce irrelevant results.
For more information, see Prefix searching by attribute.
Usage
- Attribute names are case-sensitive.
-
To disable prefix matching for an attribute, ensure it’s listed as a separate entry in
searchableAttributes. Attributes with equal priority (grouped together as a single entry) can’t be targeted bydisablePrefixOnAttributes. For example:
There’s no hard limit on the number of attributes you can include,
but adding too many can slow down
getSettings operations
and degrade performance in the Algolia dashboard.Example
Current API clients
Current API clients
Legacy API clients
Legacy API clients