Fail to create alias using transport client

I use below command to add an alias

client.admin().indices().prepareAliases().addAlias(index, alias).execute().actionGet();

but always gets an exception:

org.elasticsearch.indices.InvalidAliasNameException: Invalid alias name [active_index], an index exists with the same name as the alias

when I use:

client.admin().indices().prepareAliases().removeAlias(index, alias).execute().actionGet();

to remove all index from an alias, will an index has the same name with alias be left in the system?

The alias name must be one of the current index names. You may get all the index names before and make sure the alias name is not anyone of the names.

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