# Alias filtering issue

**URL:** <https://discuss.elastic.co/t/alias-filtering-issue/54008>\
**Category:** Elasticsearch\
**Created:** [June 27, 2016, 8:13am UTC](https://discuss.elastic.co/t/alias-filtering-issue/54008 "2016-06-27T08:13:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvdvis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvdvis/32/10556_2.png) [@mvdvis](https://discuss.elastic.co/u/mvdvis)\
**Post date:** [June 27, 2016, 8:13am UTC](https://discuss.elastic.co/t/alias-filtering-issue/54008/1 "2016-06-27T08:13:50Z")

</div>

Hello,

I'm trying to setup our ES with index aliassing and filtering. I'm getting unclear results when using the /\_aliases endpoint to setup new aliases.

Based on the examples on the site, I've tried to get this to work.

```
PUT users/_alias/user_12
{
    "filter" : {
        "term": { "user_id" : "12" }
    }
}

GET /user_12/_search
=> This does return the 'filtered' results using the term above

```

From my point of view, the code below should do exactly the same. However this doesnt return any results:

```
POST /_aliases
{
	"actions" : [{
            "add" : {
                 "index" : "users",
                 "alias" : "user_12",
                 "filter" : { "term" : { "user_id" : "12" } }
            }
        }]
}

```

The 'filter' isnt stored when using the method above:

```
GET /_aliases

==>
{
  "users": {
    "aliases": {
      "user_12": {}
    }
  }
}

```

What am I missing here?

---

<div class="post-metadata">

**Author:** ![mvdvis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvdvis/32/10556_2.png) [@mvdvis](https://discuss.elastic.co/u/mvdvis)\
**Post date:** [June 28, 2016, 7:05am UTC](https://discuss.elastic.co/t/alias-filtering-issue/54008/2 "2016-06-28T07:05:01Z")

</div>

I have found the issue. This seems to be a bug in version 2.2.0.

After upgrading to the latest release (2.3.3) this solved the issue and the example above works correctly.

---

<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, 10:40pm UTC](https://discuss.elastic.co/t/alias-filtering-issue/54008/3 "2017-07-05T22:40:03Z")

</div>


