Skip to main content
  • Type: list<string>
  • Default: [](all string attributes)
  • Scope: settings
  • Deprecated name: attributesToIndex
This parameter determines which attributes Algolia searches and in which order of relevance. It’s one of the most important settings for controlling search precision and ranking:
  • Limits the attributes Algolia uses to find matches. Avoid searching attributes like URLs or image paths.
  • Attributes listed first are more important for ranking. Records matching higher-priority attributes rank higher than those matching lower-priority attributes.
To learn more, see Searchable attributes.
Updating the searchableAttributes parameter rebuilds your index. If you need near real-time indexing, avoid changing the index configuration during high-traffic times.

Usage

Default

If unset or set to an empty list, Algolia searches all string-based attributes. This turns off the Attributes ranking criterion.

Priority order

Attributes are searched in the order they appear. Earlier attributes have higher ranking weight. By default, matches at the beginning of an attribute rank higher. To ignore the position of matches within an attribute, use modifiers.

Attributes with the same priority

To make two attributes equally important, include them in the same comma-separated string. Attributes with the same priority as others are always unordered.

Nested attributes

You can specify nested attributes, such as, categories.lvl0.label. If you specify a parent attribute, all nested attributes are searchable.

Case-sensitive

Attribute names are case-sensitive.
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.

Modifiers

unordered
Ignores the position of a match within the attribute. By default, matches at the beginning of an attribute rank higher. Setting an attribute as unordered treats all matches within the attribute equally.
  • Attributes with the same priority at the same level are always unordered
  • The default differs between API (ordered) and Algolia dashboard (unordered).

Example

The following configuration:
  • Gives equal priority to title and alternative_title
  • Ranks author next
  • Applies unordered to text so that the match position doesn’t influence ranking
  • Searches only the personal field within the nested emails attribute

Current API clients

var response = await client.SetSettingsAsync(
  "ALGOLIA_INDEX_NAME",
  new IndexSettings
  {
    SearchableAttributes = new List<string>
    {
      "title,alternative_title",
      "author",
      "unordered(text)",
      "emails.personal",
    },
  }
);
IndexSettings settings = new IndexSettings
{
    SearchableAttributes = new List
    {
      "title,alternative_title",
      "author",
      "unordered(text)",
      "emails.personal"
    }
};

index.SetSettings(settings);
I