How to disable delete from an alias which cover multiple indices?


(Lei Xu) #1

Hi guys,

I create multiple indices with the following template:

{
  "order": 0,
  "template": "my-index-*",
  "settings": {},
  "mappings": {},
  "aliases": {
    "my-index": {}
  }
}

And insert some docs with a python script via bulk api, like the following:

green open my-index-1.14 1 0 4999 0 2.3mb 2.3mb 
green open my-index-1.15 1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.16 1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.17 1 0 4999 0 2.1mb 2.1mb 
green open my-index-1.10 1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.11 1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.12 1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.1  1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.2  1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.3  1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.4  1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.5  1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.6  1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.7  1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.8  1 0 4999 0 2.6mb 2.6mb 
green open my-index-1.9  1 0 4999 0 2.6mb 2.6mb 

The alias "my-index" work fine with query and filter, but if I send a delete index request with the alias:

curl -XDELETE http://127.0.0.1:9200/my-index

Elasticsearch remove all index with this alias, it looks very dangerous if I put an alias in all indices.

so my question is, how to disable delete request if it hit an alias ?

Thanks.


(Christoph) #2

Hi,

I think this issue (https://github.com/elastic/elasticsearch/issues/2318) talks about this. Unfortunately it is not closed yet but it is on the radar.


(Lei Xu) #3

Hey @cbuescher, thanks so much.


(system) #4

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