Skip to main content
The 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 by disablePrefixOnAttributes. For example:
    [
      'sku',
      'barcode,serial_number,buzz' 
    ]
    
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

var response = await client.SetSettingsAsync(
  "ALGOLIA_INDEX_NAME",
  new IndexSettings { DisablePrefixOnAttributes = new List<string> { "serial_number" } }
);
IndexSettings settings = new IndexSettings();
settings.DisablePrefixOnAttributes = new List
{
  "sku"
};

index.SetSettings(settings);