API Reference / API Parameters / disablePrefixOnAttributes
Type: list of strings
Engine default: []
Parameter syntax
'disablePrefixOnAttributes' => [
  'attribute',
  ...
]

Can be used in these methods:
setSettings

About this parameter# A

List of attributes on which you want to disable prefix matching.

This setting is useful on attributes that contain strings that should not be matched as a prefix (for example a product SKU).

Usage notes#

  • The list must be a subset of the searchableAttributes index setting.
  • searchableAttributes must not be empty nor null for disablePrefixOnAttributes to be applied.

Examples# A

Disable prefix search for some attributes by default#

1
2
3
4
5
$index->setSettings([
  'disablePrefixOnAttributes' => [
    'sku',
  ]
]);
Did you find this page helpful?
PHP v3