# Aliases and percolators

**URL:** <https://discuss.elastic.co/t/aliases-and-percolators/17567>\
**Category:** Elasticsearch\
**Created:** [May 17, 2014, 1:54am UTC](https://discuss.elastic.co/t/aliases-and-percolators/17567 "2014-05-17T01:54:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Dodwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_dodwell/32/1446_2.png) [@Mark\_Dodwell](https://discuss.elastic.co/u/Mark_Dodwell)\
**Post date:** [May 17, 2014, 1:54am UTC](https://discuss.elastic.co/t/aliases-and-percolators/17567/1 "2014-05-17T01:54:05Z")

</div>

Consider an index `idx`, with a mapping for a single type `docs`. Consider  
aliases of the format `idx-{ACCOUNT-ID}`, with a term filter and a routing  
value set to the account id, like so:

```auto
$ curl http://0.0.0.0:9200/idx/_aliases?pretty=1
{
  "idx" : {
    "aliases" : {
      "idx-1" : {
        "filter" : {
          "term" : {
            "account_id" : 1
          }
        },
        "index_routing" : 1,
        "search_routing" : 1
      },
      ...
    }
  }
}

```

### Questions

1. When indexing a percolator query, if you do that via an alias, will it  
respect the routing?

```auto
# will the alias routing from idx-1 apply to this operation?
curl -XPUT http://0.0.0.0:9200/idx-1/.percolator/1 -d '{query:..., 
account_id:1}'

```

1. When percolating an existing document from one of those aliases, will  
the routing and term filter from the alias be used when retrieving/checking  
the matching percolator documents?

```auto
# will the alias routing and term filter from idx-1 apply to the 
percolators?
curl http://0.0.0.0:9200/idx-1/docs/123/_percolate

```

Any insight much appreciated.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [May 20, 2014, 9:18am UTC](https://discuss.elastic.co/t/aliases-and-percolators/17567/2 "2014-05-20T09:18:02Z")

</div>

1. Yes, the routing will be taken into during adding the percolator query.
2. At the moment only the routing will be taken into account, the filter  
will not be taken into account.

I opened issue percolator against an alias with a filter:

> <https://github.com/elastic/elasticsearch/issues/6241>
>
> At the moment if a document is being percolated via an alias the filter isn't ta…ken into account. The percolator should take the alias filter into account.
> 
> The alias routing is taken into account.

On 17 May 2014 03:54, Mark Dodwell [mark@mkdynamic.co.uk](mailto:mark@mkdynamic.co.uk) wrote:

> Consider an index `idx`, with a mapping for a single type `docs`. Consider  
> aliases of the format `idx-{ACCOUNT-ID}`, with a term filter and a routing  
> value set to the account id, like so:
> 
> ```auto
> $ curl http://0.0.0.0:9200/idx/_aliases?pretty=1
> {
> "idx" : {
> "aliases" : {
> "idx-1" : {
> "filter" : {
> "term" : {
> "account_id" : 1
> }
> },
> "index_routing" : 1,
> "search_routing" : 1
> },
> ...
> }
> }
> }
> 
> ```
> 
> ### Questions
> 
> 1. When indexing a percolator query, if you do that via an alias, will it  
> respect the routing?
> 
> ```auto
> # will the alias routing from idx-1 apply to this operation?
> curl -XPUT http://0.0.0.0:9200/idx-1/.percolator/1 -d '{query:...,
> account_id:1}'
> 
> ```
> 
> 1. When percolating an existing document from one of those aliases, will  
> the routing and term filter from the alias be used when retrieving/checking  
> the matching percolator documents?
> 
> ```auto
> # will the alias routing and term filter from idx-1 apply to the
> percolators?
> curl http://0.0.0.0:9200/idx-1/docs/123/_percolate
> 
> ```
> 
> Any insight much appreciated.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CA%2BA76Tx2fL858DuX1BghZUpPvSF6x--R4auDPzoqfoGTNiYQxA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BA76Tx2fL858DuX1BghZUpPvSF6x--R4auDPzoqfoGTNiYQxA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Mark\_Dodwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_dodwell/32/1446_2.png) [@Mark\_Dodwell](https://discuss.elastic.co/u/Mark_Dodwell)\
**Post date:** [May 21, 2014, 12:34am UTC](https://discuss.elastic.co/t/aliases-and-percolators/17567/3 "2014-05-21T00:34:01Z")

</div>

Many thanks, that is a super clear answer.

So, until that issue is addressed, am I correct in thinking I should do  
this when percolating an existing document:

```auto
curl http://0.0.0.0:9200/idx-1/docs/123/_percolate -d '{
  "filter": {
    "term": {
      "account_id": 1
    }
  }
}'

```

Thanks again.

On Tuesday, May 20, 2014 2:18:02 AM UTC-7, Martijn v Groningen wrote:

> 1. Yes, the routing will be taken into during adding the percolator query.
> 2. At the moment only the routing will be taken into account, the filter  
> will not be taken into account.
> 
> I opened issue percolator against an alias with a filter:  
> [Percolator should also take the filter of an alias into account. · Issue #6241 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/6241)
> 
> On 17 May 2014 03:54, Mark Dodwell \<[ma...@mkdynamic.co.uk](mailto:ma...@mkdynamic.co.uk) \<javascript:\>\>wrote:
> 
> > Consider an index `idx`, with a mapping for a single type `docs`.  
> > Consider aliases of the format `idx-{ACCOUNT-ID}`, with a term filter and a  
> > routing value set to the account id, like so:
> > 
> > ```auto
> > $ curl http://0.0.0.0:9200/idx/_aliases?pretty=1
> > {
> > "idx" : {
> > "aliases" : {
> > "idx-1" : {
> > "filter" : {
> > "term" : {
> > "account_id" : 1
> > }
> > },
> > "index_routing" : 1,
> > "search_routing" : 1
> > },
> > ...
> > }
> > }
> > }
> > 
> > ```
> > 
> > ### Questions
> > 
> > 1. When indexing a percolator query, if you do that via an alias, will it  
> > respect the routing?
> > 
> > ```auto
> > # will the alias routing from idx-1 apply to this operation?
> > curl -XPUT http://0.0.0.0:9200/idx-1/.percolator/1 -d '{query:..., 
> > account_id:1}'
> > 
> > ```
> > 
> > 1. When percolating an existing document from one of those aliases, will  
> > the routing and term filter from the alias be used when retrieving/checking  
> > the matching percolator documents?
> > 
> > ```auto
> > # will the alias routing and term filter from idx-1 apply to the 
> > percolators?
> > curl http://0.0.0.0:9200/idx-1/docs/123/_percolate
> > 
> > ```
> > 
> > Any insight much appreciated.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cfe66aa8-1af7-4aac-b5f0-e5c897b2f5b4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cfe66aa8-1af7-4aac-b5f0-e5c897b2f5b4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [May 22, 2014, 7:49am UTC](https://discuss.elastic.co/t/aliases-and-percolators/17567/4 "2014-05-22T07:49:38Z")

</div>

Yes, that is correct.

Martijn

On 21 May 2014 02:34, Mark Dodwell [mark@mkdynamic.co.uk](mailto:mark@mkdynamic.co.uk) wrote:

> Many thanks, that is a super clear answer.
> 
> So, until that issue is addressed, am I correct in thinking I should do  
> this when percolating an existing document:
> 
> ```auto
> curl http://0.0.0.0:9200/idx-1/docs/123/_percolate -d '{
> "filter": {
> "term": {
> "account_id": 1
> }
> }
> }'
> 
> ```
> 
> Thanks again.
> 
> On Tuesday, May 20, 2014 2:18:02 AM UTC-7, Martijn v Groningen wrote:
> 
> > 1. Yes, the routing will be taken into during adding the percolator query.
> > 2. At the moment only the routing will be taken into account, the filter  
> > will not be taken into account.
> > 
> > I opened issue percolator against an alias with a filter:  
> > [Percolator should also take the filter of an alias into account. · Issue #6241 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/6241)
> > 
> > On 17 May 2014 03:54, Mark Dodwell [ma...@mkdynamic.co.uk](mailto:ma...@mkdynamic.co.uk) wrote:
> > 
> > > Consider an index `idx`, with a mapping for a single type `docs`.  
> > > Consider aliases of the format `idx-{ACCOUNT-ID}`, with a term filter and a  
> > > routing value set to the account id, like so:
> > > 
> > > ```auto
> > > $ curl http://0.0.0.0:9200/idx/_aliases?pretty=1
> > > {
> > > "idx" : {
> > > "aliases" : {
> > > "idx-1" : {
> > > "filter" : {
> > > "term" : {
> > > "account_id" : 1
> > > }
> > > },
> > > "index_routing" : 1,
> > > "search_routing" : 1
> > > },
> > > ...
> > > }
> > > }
> > > }
> > > 
> > > ```
> > > 
> > > ### Questions
> > > 
> > > 1. When indexing a percolator query, if you do that via an alias, will  
> > > it respect the routing?
> > > 
> > > ```auto
> > > # will the alias routing from idx-1 apply to this operation?
> > > curl -XPUT http://0.0.0.0:9200/idx-1/.percolator/1 -d '{query:...,
> > > account_id:1}'
> > > 
> > > ```
> > > 
> > > 1. When percolating an existing document from one of those aliases, will  
> > > the routing and term filter from the alias be used when retrieving/checking  
> > > the matching percolator documents?
> > > 
> > > ```auto
> > > # will the alias routing and term filter from idx-1 apply to the
> > > percolators?
> > > curl http://0.0.0.0:9200/idx-1/docs/123/_percolate
> > > 
> > > ```
> > > 
> > > Any insight much appreciated.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > 
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%  
> > > [40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d2eb11ca-4ef2-467c-90c3-1d98e56c2ae0%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > Met vriendelijke groet,
> > 
> > Martijn van Groningen

--  
Met vriendelijke groet,

Martijn van Groningen

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CA%2BA76TyxhcP46tDQ-z1fDePj7837Hk67xhOCo%3D-U9YXg4D-xuw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BA76TyxhcP46tDQ-z1fDePj7837Hk67xhOCo%3D-U9YXg4D-xuw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:27am UTC](https://discuss.elastic.co/t/aliases-and-percolators/17567/5 "2017-07-06T01:27:43Z")

</div>


