Replica indices
Algolia uses one ranking strategy per index. If you want to provide more ranking or sorting strategies, add replica indices with theadd_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 records for the current model.
For more information, see Zero-downtime indexingTarget multiple indices
To index records in several indices, use theadd_index
method.
Ruby