Setting rollover alias and _is_write_index on index creation

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

OpenSearch 2.5

Describe the issue:

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?

Configuration:

Relevant Logs or Screenshots:

Hi @larsy,

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())));

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.