How do you set a rollover alias when creating an index with the OpenSearch client (C#)? Also, how do you set other attributes, like is_write_index? Is this even supported and if it isn’t, how would you do it?
This is definitely possible with the C#/.NET client, you can achieve this like either of the following depending on if you prefer the fluent style or not:
await osClient.Indices.CreateAsync(new CreateIndexRequest("test-index")
{
Aliases = new Aliases
{
{"my-alias", new Alias {IsWriteIndex = true}}
}
});
// OR
await osClient.Indices.CreateAsync("test-index", create => create
.Aliases(aliases => aliases
.Alias("my-alias", alias => alias.IsWriteIndex())));