# Index Aliases: delete index by alias

**URL:** https://discuss.elastic.co/t/index-aliases-delete-index-by-alias/8692
**Category:** Elasticsearch
**Created:** [August 9, 2012, 2:00pm UTC](https://discuss.elastic.co/t/index-aliases-delete-index-by-alias/8692 "2012-08-09T14:00:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Marcin\_Dojwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_dojwa/32/2307_2.png) [@Marcin\_Dojwa](https://discuss.elastic.co/u/Marcin_Dojwa)
#### Post date: [August 9, 2012, 2:00pm UTC](https://discuss.elastic.co/t/index-aliases-delete-index-by-alias/8692/1 "2012-08-09T14:00:34Z")

</div>

Hi,

Is behaviour described below normal?  
Lets:

- create index test
- create 2 filtered index aliases, t1 (with filter val=1) and t2 (with  
filter val=2)
- delete index by alias t1 - this deletes whole index test instead of all  
the documents from test that matches filter val=1.

Is it a bug or it behaves like this and nothing can be done with that ? 🙂

Best regards.  
Marcin Dojwa

---

<div class="post-metadata">

### Author: ![Alex\_Lopez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_lopez/32/2754_2.png) [@Alex\_Lopez](https://discuss.elastic.co/u/Alex_Lopez)
#### Post date: [August 9, 2012, 2:21pm UTC](https://discuss.elastic.co/t/index-aliases-delete-index-by-alias/8692/2 "2012-08-09T14:21:17Z")

</div>

Hi,

I think deletion of an index by its alias is expected behavior, if you want  
to delete all documents in an index there should be another way of  
achieving that (  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/delete-by-query.html)).

On Thursday, August 9, 2012 3:00:34 PM UTC+1, Marcin Dojwa wrote:

> Hi,
> 
> Is behaviour described below normal?  
> Lets:
> 
> - create index test
> - create 2 filtered index aliases, t1 (with filter val=1) and t2 (with  
> filter val=2)
> - delete index by alias t1 - this deletes whole index test instead of all  
> the documents from test that matches filter val=1.
> 
> Is it a bug or it behaves like this and nothing can be done with that ? 🙂
> 
> Best regards.  
> Marcin Dojwa

---

<div class="post-metadata">

### Author: ![Marcin\_Dojwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_dojwa/32/2307_2.png) [@Marcin\_Dojwa](https://discuss.elastic.co/u/Marcin_Dojwa)
#### Post date: [August 9, 2012, 8:27pm UTC](https://discuss.elastic.co/t/index-aliases-delete-index-by-alias/8692/3 "2012-08-09T20:27:40Z")

</div>

Thank you for help.

Best regards.

2012/8/9 Alex López [aliksandr@gmail.com](mailto:aliksandr@gmail.com)

> Hi,
> 
> I think deletion of an index by its alias is expected behavior, if you  
> want to delete all documents in an index there should be another way of  
> achieving that (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/delete-by-query.html)).
> 
> On Thursday, August 9, 2012 3:00:34 PM UTC+1, Marcin Dojwa wrote:
> 
> > Hi,
> > 
> > Is behaviour described below normal?  
> > Lets:
> > 
> > - create index test
> > - create 2 filtered index aliases, t1 (with filter val=1) and t2 (with  
> > filter val=2)
> > - delete index by alias t1 - this deletes whole index test instead of all  
> > the documents from test that matches filter val=1.
> > 
> > Is it a bug or it behaves like this and nothing can be done with that ? 🙂
> > 
> > Best regards.  
> > Marcin Dojwa

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 3:16am UTC](https://discuss.elastic.co/t/index-aliases-delete-index-by-alias/8692/4 "2017-07-06T03:16:53Z")

</div>


