Replica update the ranking setting

After copying the Settings from the index to its replicas by

client.CopySettings(“index”,“replica”);

want to update the replica ranking setting in C#/.NET
is there a direct way or have to create for each replica a
SearchIndex and then IndexSettings, index.SetSettings(settings, forwardToReplicas: true) ?

Hi @henrique.corte,

From your question,

it sounds like you are able to successfully instantiate a replica index, add the general settings, and now would like to apply the custom setting that makes your replica unique. Is that correct?

The steps you described indeed are the way to go, but you can directly apply them to the replica index - you don’t have to apply them to the primary index and then forward to replicas:

SearchClient client = new SearchClient("MY_APP_ID", "MY_ADMIN_API_KEY");
SearchIndex replicaIndex = client.InitIndex("your_replica_name");

IndexSettings settings = new IndexSettings
{
  CustomRanking = new List<string> { "desc(followers)" }
};

replicaIndex.SetSettings(settings);

Hi @ ajay.david thanks for the answer,

Yes was able to create my settings for my index and copy that settings to the replica index’s with the client.CopySettings, and now needed to change for each replica the ranking that makes each replica unique as you sayed.
Gona follow as you indicated, that was also my idea but since there was that method to copy the Setting of one index to another in this case replica thought that would be possible to have a option to update the replicas ranking associated to this index.

1 Like