API Reference / API Parameters / disablePrefixOnAttributes
Jan. 14, 2019

disablePrefixOnAttributes

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

Can be used in these methods:

About this parameter

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

Disable prefix search for some attributes by default

1
2
3
4
5
$index->setSettings([
  'disablePrefixOnAttributes' => [
    'sku',
  ]
]);

Did you find this page helpful?