Skip to main content
  • Type: list<string>
  • Default: [](no replicas)
  • Scope: settings
  • Deprecated name: slaves
Use replicas to create copies of your primary index with a different configuration (settings, synonyms, rules). Replicas are useful for: The data in a replica stays synchronized with its primary index. All indexing operations on the primary (add, update, delete) are automatically forwarded to its replicas. A primary index can have multiple replicas, but each replica must have exactly one primary. Replicas can’t have their own replicas. The primary setting is automatically added to a replica’s settings with the name of the primary index.

Usage

  • This setting specifies the complete set of replicas for an index.
  • Adding a new replica to this list:
    • Creates a new replica index if it doesn’t exist.
    • Overwrites the records of an existing replica index with the same name. Its settings remain unchanged. To sync the settings from the primary, either copy the settings to the replica or delete the replica index before recreating it.
  • Removing a replica from the list detaches it and turns it into a regular index. Then, you can delete it like any other index.

Example

Current API clients

var response = await client.SetSettingsAsync(
  "ALGOLIA_INDEX_NAME",
  new IndexSettings
  {
    Replicas = new List<string> { "name_of_replica_index1", "name_of_replica_index2" },
  }
);
IndexSettings settings = new IndexSettings();
settings.Replicas = new List
{
    "replica_1",
    "replica_2"
};

index.SetSettings(settings);
I