Create a Replica Index
By design, Algolia provides one ranking formula per index; therefore, when you want to provide different rankings for the same data, you need to use different indices for each ranking. These additional indices are called replicas.
You can create replicas through the API and the Dashboard.
Using the API
To create replicas, you need to use the
setSettings method on your primary index. You can add more than one replica at a time if you want to provide multiple alternative sorting strategies.
1 2 3 4 5 $index->setSettings([ 'replicas' => [ 'products_price_desc' ] ]);
Using the Dashboard
- Go to your dashboard and select your index.
- Click the Replicas tab.
- Click the “Create Replica Index” button, type a name for your replica and press
- Repeat for all additional replicas you want to add.
- Don’t forget to save your changes.