Removing an index from an alias in Elasticsearch

How to remove an index from an alias? That is, I no longer need to associate the index with an alias.

My second question is: can an alias exist without any indexes?

+6
source share
2 answers

Add an alias:

POST _aliases { "actions": [ { "add": { "index": ".marvel-2015.06.05", "alias": "alias1" } }, { "add": { "index": ".marvel-2015.06.04", "alias": "alias1" } } ] } 

List the alias:

 GET /alias1/_alias 

Delete one index:

 POST _aliases { "actions": [ { "remove": { "index": ".marvel-2015.06.05", "alias": "alias1" } } ] } 

And no, an alias cannot exist without indexes: https://github.com/elastic/elasticsearch/issues/7864

+12
source

If you do not know the name of the index and want to remove the alias from all indexes

 Post: /_aliases { "actions" : [ { "remove" : { "index" : "*", "alias" : "nameOfAlias" } } ] } 
+2
source

Source: https://habr.com/ru/post/988575/


All Articles