Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing an index from an alias in Elasticsearch

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

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

like image 588
user11081980 Avatar asked Jun 05 '15 13:06

user11081980


People also ask

How do I delete an alias index?

To remove all aliases, use * or _all . (Required, string) Comma-separated list of data streams or indices used to limit the request. Supports wildcards ( * ).

How do I delete a specific index in Elasticsearch?

To delete the index, you must roll over the data stream so a new write index is created. You can then use the delete index API to delete the previous write index.

Is it safe to delete indices in Elasticsearch?

you can freely delete your indexes (from the indexes panel) in either graylog or elasticsearch, just recalculate your indexes after. you may want to update your retention policy to fit your storage availability. I would rotate them based on space, and then only keep the number of indexes you have room for.

What is alias for index in Elasticsearch?

An alias is a secondary name for a group of data streams or indices. Most Elasticsearch APIs accept an alias in place of a data stream or index name. You can change the data streams or indices of an alias at any time.


2 Answers

In case you don't know the name of index and you want to remove alias from all indexes

Post: /_aliases
{
 "actions" : [
    { "remove" : { "index" : "*", "alias" : "nameOfAlias" } }
 ]
}
like image 56
Jay Shah Avatar answered Sep 28 '22 10:09

Jay Shah


DELETE /yourindex/_alias/unwantedalias
like image 35
Fabien Haddadi Avatar answered Sep 28 '22 11:09

Fabien Haddadi