# Setting rollover alias and \_is\_write\_index on index creation

**URL:** <https://forum.opensearch.org/t/setting-rollover-alias-and-is-write-index-on-index-creation/15277>\
**Category:** OpenSearch Client Libraries\
**Tags:** clients-general, opensearch-net\
**Created:** [July 26, 2023, 1:35pm UTC](https://forum.opensearch.org/t/setting-rollover-alias-and-is-write-index-on-index-creation/15277 "2023-07-26T13:35:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![larsy](https://avatars.discourse-cdn.com/v4/letter/l/258eb7/32.png) [@larsy](https://forum.opensearch.org/u/larsy)\
**Post date:** [July 26, 2023, 1:35pm UTC](https://forum.opensearch.org/t/setting-rollover-alias-and-is-write-index-on-index-creation/15277/1 "2023-07-26T13:35:33Z")

</div>

**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** :

---

<div class="post-metadata">

**Author:** ![xtansia](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/xtansia/32/4961_2.png) [@xtansia](https://forum.opensearch.org/u/xtansia)\
**Post date:** [July 26, 2023, 10:49pm UTC](https://forum.opensearch.org/t/setting-rollover-alias-and-is-write-index-on-index-creation/15277/2 "2023-07-26T22:49:50Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [September 24, 2023, 10:50pm UTC](https://forum.opensearch.org/t/setting-rollover-alias-and-is-write-index-on-index-creation/15277/3 "2023-09-24T22:50:22Z")

</div>

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