Guides / Solutions / Ecommerce / Business user guide / Initial configuration

A replica index is a copy of your index, that allows you to use different ranking strategies, for example, a different custom ranking, or sorting.

Copying settings between applications and indices

The data from your indices and their analytics are two different data sets on two different services. The analytics data references its corresponding index by name. This reference never changes. This has the following consequences:

  • When copying an index, the associated analytics data isn’t copied.
  • When deleting an index, the associated analytics data isn’t deleted, allowing you to export and back up the analytics data.

    Your engineering team can export the analytics data using an API client. You can’t export analytics data from the dashboard.

  • When renaming an index, Algolia collects new analytics data. The old and new analytics data won’t be merged.

Creating new replica indices

Each index has one ranking strategy. If you want to allow sorting the search results by different attributes, you can use replicas. For each different sorting strategy, you need one replica index. For example, if you want to allow sorting the search results alphabetically in ascending and descending order, you need to create two replica indices.

  1. Go to the Index section in the Algolia dashboard.
  2. Select the index for which you want to create replica indices.
  3. Select the Replicas tab.
  4. Click Create Replica Index.

    Manage replica indices in the dashboard

  5. In the Create a new replica dialog, enter a name for the new replica index.
  6. Choose between standard replica or virtual replica.

    Standard replicas duplicate the primary index’s records. Virtual replicas don’t duplicate the data set, but you can adjust only a subset of the primary index’s settings.

  7. Click Create replica.

    Create a new replica index in the dashboard

  8. Optional: you can create more than one replica.
  9. Save your changes.

Switching replica indices for different sorting strategies

If you want to allow users to sort the search results in different ways, you need to:

  • Have one replica index per sorting strategy
  • Switch the Algolia index or replica when the user changes the sorting strategy in your frontend

For example, to allow sorting by price, you need three indices. One primary index with the default ranking of the search results, and two replica indices where the results are sorted by price, one for ascending, another for descending sort order.

You might need your engineering team’s help to replica the index for each searching strategy.

Forwarding settings to replica indices

With replica indices, you can apply different ranking strategies to your data, for example, custom ranking, or sorting. Settings and attributes that are the same between the replica indices are synced with the primary index. If you change a setting in your primary index, you must forward the changes to your replica indices.

Forwarding index settings

To forward a change of an index setting to the replica indices:

  1. Change an index setting in the Index section of the dashboard and review the change.
  2. In the Review and save settings dialog, select Copy these settings to other indices and/or replicas to forward the changes to a subset or all replicas.

    Forward index configuration changes to replica indices automatically

Forwarding synonyms and rules

When adding, editing, or deleting synonyms or rules, select the Forward to replicas option to copy these changes to the replica indices.

  1. Go to the AI Synonyms page in the dashboard.
  2. Select Forward to replicas

    Forward AI Synonyms and Rules to replica indices automatically

  3. Review and publish the changes.

    Review your changes and forward AI synonyms to your replica indices

Did you find this page helpful?