Bulk index and Aliases creation

HI ,

I have a requirement of creating multiple indices and aliases for the same. Is there any way i can create multiple indices and multiple aliases in one request . I'm new to ES and I'm using NEST.

Thanks
Naveen

Indices are created one by one unless you are just using the bulk API which can automatically create needed indices.

You can use index templates to make sure each index you will create (automatically or not) follows the pattern you wish (settings, mappings...). It includes setting alias for this index.

HTH

Thanks a lot @dadoonet , Index template helped me to solve this . i did like below.

        var aliasesDescriptor = new AliasesDescriptor();
        Configuration.Aliases.ForEach(alias =>
        {
            aliasesDescriptor.Alias(alias);
        });

        var indexDescriptor = new CreateIndexDescriptor(Configuration.IndexName)
           .Mappings(ms => ms.Map<T>(m => m.AutoMap())).Aliases(a => a.CopyTo(aliasesDescriptor));

        var createIndexResponse = await Client.CreateIndexAsync(indexDescriptor, cancellationToken);

By index templates I meant this built-in feature: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html

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