Guides / Managing results / Refine results / Sorting results

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

Creating a replica through the dashboard

  1. Go to your dashboard and select your index.
  2. Click the Replicas tab.
  3. Click the “Create Replica Index” button, type a name for your replica and press Enter.
  4. Repeat for all additional replicas you want to add.
  5. Don’t forget to save your changes.

Did you find this page helpful?