Skip to main content

Replica indices

Algolia uses one ranking strategy per . If you want to provide more ranking or sorting strategies, add replica indices with the add_replica method. To inherit the settings from the primary index, add inherit:true.
Ruby

Share a single index

If you want to share an index for multiple models, make sure that your object IDs are unique. For example, you can prepend the model class name to the record’s ID:
Ruby
To reindex a model that’s part of a shared index, you must use Model.reindex! instead of Model.reindex. If you use reindex, the resulting index would only contain for the current model. For more information, see Zero-downtime indexing

Target multiple indices

To index records in several indices, use the add_index method.
Ruby
Last modified on June 12, 2026