# 2 filtered aliases with filters of first alias included in the filters of the second?

**URL:** <https://discuss.elastic.co/t/2-filtered-aliases-with-filters-of-first-alias-included-in-the-filters-of-the-second/39756>\
**Category:** Elasticsearch\
**Created:** [January 21, 2016, 10:43am UTC](https://discuss.elastic.co/t/2-filtered-aliases-with-filters-of-first-alias-included-in-the-filters-of-the-second/39756 "2016-01-21T10:43:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandros/32/6348_2.png) [@sandros](https://discuss.elastic.co/u/sandros)\
**Post date:** [January 21, 2016, 10:43am UTC](https://discuss.elastic.co/t/2-filtered-aliases-with-filters-of-first-alias-included-in-the-filters-of-the-second/39756/1 "2016-01-21T10:43:32Z")

</div>

Hi all,

So far I have one alias defined as (pythonAPI):  
`bod = { "filter": { "bool": { "must": [{ "term": {"client": "CC"} }, { "term": {"meta": 1} }], } }} es.indices.put_alias(index=INDEX_NAME, name="meta_CC", body=bod)`

Now I want to define a new alias for the same client, also for meta==1 and in addition only for entries having another field PPP==1. SO I would do:

`bod = { "filter": { "bool": { "must": [{ "term": {"client": "CC"} }, { "term": {"meta": 1} } , { "term": {"PPP": 1} }], } }} es.indices.put_alias(index=INDEX_NAME, name="meta_CC_P1", body=bod)`

What I don't know is what happens to documents wich match both filters? I.e docs with:

> client==CC, meta==1 and PPP=1 ?

I for sure can find them looking in the alias _meta\_CC\_P1_, but will they also be found in the alias _meta\_CC_?

If they are found in both, is the only way to not have them in both to add a _PPP!= 1_ to the meta\_CC alias? And if this is true, is it possible to update an alias or I need to create a new one?

---

<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 5, 2017, 11:22pm UTC](https://discuss.elastic.co/t/2-filtered-aliases-with-filters-of-first-alias-included-in-the-filters-of-the-second/39756/2 "2017-07-05T23:22:35Z")

</div>


