Skip to main content

Index names

Index names are derived from the class names. To customize the index names, pass a string to the index_name option.
Ruby

Production and staging indices

To avoid changing your production index, you can append the current Rails environment to the index name with the per_environment option. This creates separate indices with names following the pattern MODEL_ENVIRONMENT.
Ruby
To make it even harder to overwrite your production data, use different API keys in development and production. You can restrict access of your development API key to indices with names ending with _development. For more information, see API keys restrictions.

Basic relevance settings

To set a baseline for your index, define which attributes should be searchable and define a custom ranking.
Ruby
For more information, see:

Faceting and filtering

Add all attributes you want to use for filtering as facets.
Ruby
For more information, see:

Synonyms

You can define regular synonyms where all words are considered equivalent.
Ruby
To define other types of synonyms, directly call the saveSynonyms method on the API client.

Sync your settings with Algolia

By default, your settings will be synced with Algolia.

Turn off automatic syncing

If you turn off automatic syncing, make sure to manually send updates to Algolia whenever you change your settings.
Ruby

Apply all settings

To send settings updates for all indices, use the set_all_settings rake command. It sends updates to your primary indices, your replicas, and any indices you added with add_index. Consider adding this command to your deployment pipeline, especially if you turned off automatic settings updates.
Command line
Last modified on June 19, 2026