disablePrefixOnAttributes

Type: list of strings
Engine default: []
Parameter syntax
'disablePrefixOnAttributes' => [
  'attribute',
  ...
]
Parameter syntax
disablePrefixOnAttributes: [
  'attribute',
  ...
]
Parameter syntax
disablePrefixOnAttributes: [
  'attribute',
  ...
]
Parameter syntax
'disablePrefixOnAttributes': [
  'attribute',
  ...
]
Parameter syntax
"disablePrefixOnAttributes": [
  "attribute",
  ...
]
Parameter syntax
new JSONObject()
  .put(
    "disablePrefixOnAttributes",
    new JSONArray()
      .put("attribute")
      .put("...")
  )
Parameter syntax
dynamic settings = new JObject();
settings.disablePrefixOnAttributes = new JArray()
  .put("attribute")
  .put("...");
Parameter syntax
.setDisablePrefixOnAttributes(
  Arrays.asList(
    "attribute",
    ...
  )
)
Parameter syntax
"disablePrefixOnAttributes": []string{
  "attribute",
  ...
},
Parameter syntax
disablePrefixOnAttributes = Some(Seq(
  "attribute",
  ...
))

Can be used in these methods:
setSettings set_settings setSettings set_settings setSettings setSettingsAsync SetSettings setSettings SetSettings changeSettings

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

<?php
$index->setSettings([
  'disablePrefixOnAttributes' => [
    'sku',
  ]
]);
index.set_settings({
  disablePrefixOnAttributes: [
    'sku'
  ]
})
index.setSettings({
  disablePrefixOnAttributes: ['sku']
});
index.set_settings({
  'disablePrefixOnAttributes': [
    'sku',
  ]
})
index.setSettings([
  "disablePrefixOnAttributes": [
    "sku"
  ]
])
index.setSettings(
  new JSONObject()
    .put("disablePrefixOnAttributes", "sku")
);
dynamic settings = new JObject();
settings.disablePrefixOnAttributes = new JArray()
  .put("sku");

index.SetSettings(settings);
index.setSettings(
  new IndexSettings()
    .setDisablePrefixOnAttributes(
      Arrays.asList("sku")
    )
);
res, err := index.SetSettings(algoliasearch.Map{
  "disablePrefixOnAttributes": []string{
    "sku",
  },
})
client.execute {
  changeSettings of "myIndex" `with` IndexSettings(
    disablePrefixOnAttributes = Some(Seq(
      "sku"
    ))
  )
}
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala