# Alias functionality for /percolator/\<index name\> so clients can continue using alias when index changes

**URL:** <https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071>\
**Category:** Elasticsearch\
**Created:** [March 20, 2012, 2:37pm UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071 "2012-03-20T14:37:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nakul\_Jhalani](https://avatars.discourse-cdn.com/v4/letter/n/4bbf92/32.png) [@Nakul\_Jhalani](https://discuss.elastic.co/u/Nakul_Jhalani)\
**Post date:** [March 20, 2012, 2:37pm UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071/1 "2012-03-20T14:37:58Z")

</div>

I am setting up ES with an index say 'reports\_20120320' and alias  
'reports', so all my client operations like index/search/adding percolate  
queries happens through the index. However I am facing issue that  
percolator queries needs real index name, while index/search work fine with  
aliases. Hence my clients have to know and change real index name for  
percolation. This leads to a tighter integration between service and client  
that I would like.  
Any suggestions how can I improve the process? I am thinking of adding a  
layer in between through which percolate requests for the alias are  
translated to/between the real index name. Thanks!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 20, 2012, 8:46pm UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071/2 "2012-03-20T20:46:26Z")

</div>

Yea, registering percolator queries require the real index name. The  
percolate API will do the relevant translation from an alias to  
an actual index name, but registering them has to be against a concrete  
index. Are you after being able to register them against an "alias"? Its  
problematic since aliases can change...

On Tue, Mar 20, 2012 at 4:37 PM, Nakul Jhalani [nakul.jhalani@gmail.com](mailto:nakul.jhalani@gmail.com)wrote:

> I am setting up ES with an index say 'reports\_20120320' and alias  
> 'reports', so all my client operations like index/search/adding percolate  
> queries happens through the index. However I am facing issue that  
> percolator queries needs real index name, while index/search work fine with  
> aliases. Hence my clients have to know and change real index name for  
> percolation. This leads to a tighter integration between service and client  
> that I would like.  
> Any suggestions how can I improve the process? I am thinking of adding a  
> layer in between through which percolate requests for the alias are  
> translated to/between the real index name. Thanks!

---

<div class="post-metadata">

**Author:** ![Nakul\_Jhalani](https://avatars.discourse-cdn.com/v4/letter/n/4bbf92/32.png) [@Nakul\_Jhalani](https://discuss.elastic.co/u/Nakul_Jhalani)\
**Post date:** [March 21, 2012, 2:30pm UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071/3 "2012-03-21T14:30:04Z")

</div>

I am able to register them against alias, but they don't work because  
percolate (when indexing) checks against '\_percolator/'  
and not alias. This makes the client to use alias for search/index and  
real-index name for percolate registration/deletes.  
Wouldn't it be better if register percolate requests check if it's an alias  
and convert to real-index name automatically, logically similar to how  
search/index operations work ??

On Tuesday, March 20, 2012 4:46:26 PM UTC-4, kimchy wrote:

> Yea, registering percolator queries require the real index name. The  
> percolate API will do the relevant translation from an alias to  
> an actual index name, but registering them has to be against a concrete  
> index. Are you after being able to register them against an "alias"? Its  
> problematic since aliases can change...
> 
> On Tue, Mar 20, 2012 at 4:37 PM, Nakul Jhalani wrote:
> 
> > I am setting up ES with an index say 'reports\_20120320' and alias  
> > 'reports', so all my client operations like index/search/adding percolate  
> > queries happens through the index. However I am facing issue that  
> > percolator queries needs real index name, while index/search work fine with  
> > aliases. Hence my clients have to know and change real index name for  
> > percolation. This leads to a tighter integration between service and client  
> > that I would like.  
> > Any suggestions how can I improve the process? I am thinking of adding a  
> > layer in between through which percolate requests for the alias are  
> > translated to/between the real index name. Thanks!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 25, 2012, 10:17am UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071/4 "2012-03-25T10:17:35Z")

</div>

It is possible to have percolator queries registered against an "alias" to  
resolve to an index name, but what I am concerned about is the fact that  
you can change the alias to point to a different index, and people might  
expect the queries to "move" with the renaming of the alias (which they  
won't)....

On Wed, Mar 21, 2012 at 4:30 PM, Nakul Jhalani [nakul.jhalani@gmail.com](mailto:nakul.jhalani@gmail.com)wrote:

> I am able to register them against alias, but they don't work because  
> percolate (when indexing) checks against '\_percolator/'  
> and not alias. This makes the client to use alias for search/index and  
> real-index name for percolate registration/deletes.  
> Wouldn't it be better if register percolate requests check if it's an  
> alias and convert to real-index name automatically, logically similar to  
> how search/index operations work ??
> 
> On Tuesday, March 20, 2012 4:46:26 PM UTC-4, kimchy wrote:
> 
> > Yea, registering percolator queries require the real index name. The  
> > percolate API will do the relevant translation from an alias to  
> > an actual index name, but registering them has to be against a concrete  
> > index. Are you after being able to register them against an "alias"? Its  
> > problematic since aliases can change...
> > 
> > On Tue, Mar 20, 2012 at 4:37 PM, Nakul Jhalani wrote:
> > 
> > I am setting up ES with an index say 'reports\_20120320' and alias
> > 
> > > 'reports', so all my client operations like index/search/adding percolate  
> > > queries happens through the index. However I am facing issue that  
> > > percolator queries needs real index name, while index/search work fine with  
> > > aliases. Hence my clients have to know and change real index name for  
> > > percolation. This leads to a tighter integration between service and client  
> > > that I would like.  
> > > Any suggestions how can I improve the process? I am thinking of adding a  
> > > layer in between through which percolate requests for the alias are  
> > > translated to/between the real index name. Thanks!

---

<div class="post-metadata">

**Author:** ![Onilton\_Maciel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/onilton_maciel/32/2500_2.png) [@Onilton\_Maciel](https://discuss.elastic.co/u/Onilton_Maciel)\
**Post date:** [April 20, 2012, 4:20pm UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071/5 "2012-04-20T16:20:54Z")

</div>

> I am able to register them against alias, but they don't work because  
> percolate (when indexing) checks against '\_percolator/'  
> and not alias.  
> Wouldn't it be better if register percolate requests check if it's an alias  
> and convert to real-index name automatically, logically similar to how  
> search/index operations work ??

Instead of the percolator queries registered against an "alias" to  
resolve to an index name...

Why not the other way? I mean, just check \_percolator using the alias  
when using index alias for indexing (with percolate on)?

This can still seen inconsistent somehow, but it is nice way to keep  
your percolator queries working, even when you change your main index.

So you run index using an alias (and resolving to real-index name) but  
the percolator queries would still work.

Other nice feature I miss would be to have a wildcard for the index in  
percolator queries. This way the query would work for all indices.

On Mar 25, 6:17 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> It is possible to have percolator queries registered against an "alias" to  
> resolve to an index name, but what I am concerned about is the fact that  
> you can change the alias to point to a different index, and people might  
> expect the queries to "move" with the renaming of the alias (which they  
> won't)....
> 
> On Wed, Mar 21, 2012 at 4:30 PM, Nakul Jhalani [nakul.jhal...@gmail.com](mailto:nakul.jhal...@gmail.com)wrote:
> 
> > I am able to register them against alias, but they don't work because  
> > percolate (when indexing) checks against '\_percolator/'  
> > and not alias. This makes the client to use alias for search/index and  
> > real-index name for percolate registration/deletes.  
> > Wouldn't it be better if register percolate requests check if it's an  
> > alias and convert to real-index name automatically, logically similar to  
> > how search/index operations work ??
> 
> > On Tuesday, March 20, 2012 4:46:26 PM UTC-4, kimchy wrote:
> 
> > > Yea, registering percolator queries require the real index name. The  
> > > percolate API will do the relevant translation from an alias to  
> > > an actual index name, but registering them has to be against a concrete  
> > > index. Are you after being able to register them against an "alias"? Its  
> > > problematic since aliases can change...
> 
> > > On Tue, Mar 20, 2012 at 4:37 PM, Nakul Jhalani wrote:
> 
> > > I am setting up ES with an index say 'reports\_20120320' and alias
> > > 
> > > > 'reports', so all my client operations like index/search/adding percolate  
> > > > queries happens through the index. However I am facing issue that  
> > > > percolator queries needs real index name, while index/search work fine with  
> > > > aliases. Hence my clients have to know and change real index name for  
> > > > percolation. This leads to a tighter integration between service and client  
> > > > that I would like.  
> > > > Any suggestions how can I improve the process? I am thinking of adding a  
> > > > layer in between through which percolate requests for the alias are  
> > > > translated to/between the real index name. Thanks!

---

<div class="post-metadata">

**Author:** ![Nakul\_Jhalani](https://avatars.discourse-cdn.com/v4/letter/n/4bbf92/32.png) [@Nakul\_Jhalani](https://discuss.elastic.co/u/Nakul_Jhalani)\
**Post date:** [May 5, 2012, 9:05pm UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071/6 "2012-05-05T21:05:30Z")

</div>

So given the current behavior, there seem be two workaround when using  
aliases and percolation -

1. Register percolate queries under real index name, anytime alias is  
switched to other new index name.. re-register old percolate queries from  
\_percolator/ to \_percolator/
2. As Onilton suggested, register the queries under the alias name in  
percolator. This way we can't index and percolate at same time. They will  
have to be broken in two operations, index and then percolate against  
alias.

Shay I would be curious to know what do you think between these options or  
if you have a better suggestion? First one has more maintenance, however  
with second approach is their a performance diff (2 separate hits to ES vs

1. or any hidden pitfall.  
Thanks much!

On Friday, April 20, 2012 12:20:54 PM UTC-4, Onilton Maciel wrote:

> > I am able to register them against alias, but they don't work because  
> > percolate (when indexing) checks against '\_percolator/'  
> > and not alias.  
> > Wouldn't it be better if register percolate requests check if it's an  
> > alias  
> > and convert to real-index name automatically, logically similar to how  
> > search/index operations work ??
> 
> Instead of the percolator queries registered against an "alias" to  
> resolve to an index name...
> 
> Why not the other way? I mean, just check \_percolator using the alias  
> when using index alias for indexing (with percolate on)?
> 
> This can still seen inconsistent somehow, but it is nice way to keep  
> your percolator queries working, even when you change your main index.
> 
> So you run index using an alias (and resolving to real-index name) but  
> the percolator queries would still work.
> 
> Other nice feature I miss would be to have a wildcard for the index in  
> percolator queries. This way the query would work for all indices.
> 
> On Mar 25, 6:17 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > It is possible to have percolator queries registered against an "alias"  
> > to  
> > resolve to an index name, but what I am concerned about is the fact that  
> > you can change the alias to point to a different index, and people might  
> > expect the queries to "move" with the renaming of the alias (which they  
> > won't)....
> > 
> > On Wed, Mar 21, 2012 at 4:30 PM, Nakul Jhalani [nakul.jhal...@gmail.com](mailto:nakul.jhal...@gmail.com)wrote:
> 
> > > I am able to register them against alias, but they don't work because  
> > > percolate (when indexing) checks against '\_percolator/'  
> > > and not alias. This makes the client to use alias for search/index and  
> > > real-index name for percolate registration/deletes.  
> > > Wouldn't it be better if register percolate requests check if it's an  
> > > alias and convert to real-index name automatically, logically similar  
> > > to  
> > > how search/index operations work ??
> > 
> > > On Tuesday, March 20, 2012 4:46:26 PM UTC-4, kimchy wrote:
> > 
> > > > Yea, registering percolator queries require the real index name. The  
> > > > percolate API will do the relevant translation from an alias to  
> > > > an actual index name, but registering them has to be against a  
> > > > concrete  
> > > > index. Are you after being able to register them against an "alias"?  
> > > > Its  
> > > > problematic since aliases can change...
> > 
> > > > On Tue, Mar 20, 2012 at 4:37 PM, Nakul Jhalani wrote:
> > 
> > > > I am setting up ES with an index say 'reports\_20120320' and alias
> > > > 
> > > > > 'reports', so all my client operations like index/search/adding  
> > > > > percolate  
> > > > > queries happens through the index. However I am facing issue that  
> > > > > percolator queries needs real index name, while index/search work  
> > > > > fine with  
> > > > > aliases. Hence my clients have to know and change real index name  
> > > > > for  
> > > > > percolation. This leads to a tighter integration between service and  
> > > > > client  
> > > > > that I would like.  
> > > > > Any suggestions how can I improve the process? I am thinking of  
> > > > > adding a  
> > > > > layer in between through which percolate requests for the alias are  
> > > > > translated to/between the real index name. Thanks!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 9, 2012, 8:40am UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071/7 "2012-05-09T08:40:12Z")

</div>

Both will work, the second one wil be as fast as indexing and percolating  
at the same time. Note though, when you register a percolator against an  
alias, you still need to have an index with that name (with the correct  
mapping and all) for it to work, and obviously you can't have that index  
because the alias already exists. What you can is simply have a separate  
index that handles percolation (but with the proper mapping, since you  
won't have documents in that index to derive the mappings for).

On Sun, May 6, 2012 at 12:05 AM, Nakul Jhalani [nakul.jhalani@gmail.com](mailto:nakul.jhalani@gmail.com)wrote:

> So given the current behavior, there seem be two workaround when using  
> aliases and percolation -
> 
> 1. Register percolate queries under real index name, anytime alias is  
> switched to other new index name.. re-register old percolate queries from  
> \_percolator/ to \_percolator/
> 2. As Onilton suggested, register the queries under the alias name in  
> percolator. This way we can't index and percolate at same time. They will  
> have to be broken in two operations, index and then percolate against  
> alias.
> 
> Shay I would be curious to know what do you think between these options or  
> if you have a better suggestion? First one has more maintenance, however  
> with second approach is their a performance diff (2 separate hits to ES vs
> 
> 1. or any hidden pitfall.  
> Thanks much!
> 
> On Friday, April 20, 2012 12:20:54 PM UTC-4, Onilton Maciel wrote:
> 
> > > I am able to register them against alias, but they don't work because  
> > > percolate (when indexing) checks against '\_percolator/'  
> > > and not alias.  
> > > Wouldn't it be better if register percolate requests check if it's an  
> > > alias  
> > > and convert to real-index name automatically, logically similar to how  
> > > search/index operations work ??
> > 
> > Instead of the percolator queries registered against an "alias" to  
> > resolve to an index name...
> > 
> > Why not the other way? I mean, just check \_percolator using the alias  
> > when using index alias for indexing (with percolate on)?
> > 
> > This can still seen inconsistent somehow, but it is nice way to keep  
> > your percolator queries working, even when you change your main index.
> > 
> > So you run index using an alias (and resolving to real-index name) but  
> > the percolator queries would still work.
> > 
> > Other nice feature I miss would be to have a wildcard for the index in  
> > percolator queries. This way the query would work for all indices.
> > 
> > On Mar 25, 6:17 am, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> > 
> > > It is possible to have percolator queries registered against an "alias"  
> > > to  
> > > resolve to an index name, but what I am concerned about is the fact  
> > > that  
> > > you can change the alias to point to a different index, and people  
> > > might  
> > > expect the queries to "move" with the renaming of the alias (which they  
> > > won't)....
> > > 
> > > On Wed, Mar 21, 2012 at 4:30 PM, Nakul Jhalani \<[nakul.jhal...@gmail.com](mailto:nakul.jhal...@gmail.com)  
> > > \*\*wrote:
> > > 
> > > > I am able to register them against alias, but they don't work because  
> > > > percolate (when indexing) checks against '\_percolator/'  
> > > > and not alias. This makes the client to use alias for search/index  
> > > > and  
> > > > real-index name for percolate registration/deletes.  
> > > > Wouldn't it be better if register percolate requests check if it's an  
> > > > alias and convert to real-index name automatically, logically similar  
> > > > to  
> > > > how search/index operations work ??
> > > 
> > > > On Tuesday, March 20, 2012 4:46:26 PM UTC-4, kimchy wrote:
> > > 
> > > > > Yea, registering percolator queries require the real index name. The  
> > > > > percolate API will do the relevant translation from an alias to  
> > > > > an actual index name, but registering them has to be against a  
> > > > > concrete  
> > > > > index. Are you after being able to register them against an "alias"?  
> > > > > Its  
> > > > > problematic since aliases can change...
> > > 
> > > > > On Tue, Mar 20, 2012 at 4:37 PM, Nakul Jhalani wrote:
> > > 
> > > > > I am setting up ES with an index say 'reports\_20120320' and alias
> > > > > 
> > > > > > 'reports', so all my client operations like index/search/adding  
> > > > > > percolate  
> > > > > > queries happens through the index. However I am facing issue that  
> > > > > > percolator queries needs real index name, while index/search work  
> > > > > > fine with  
> > > > > > aliases. Hence my clients have to know and change real index name  
> > > > > > for  
> > > > > > percolation. This leads to a tighter integration between service  
> > > > > > and client  
> > > > > > that I would like.  
> > > > > > Any suggestions how can I improve the process? I am thinking of  
> > > > > > adding a  
> > > > > > layer in between through which percolate requests for the alias are  
> > > > > > translated to/between the real index name. Thanks!

---

<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:29am UTC](https://discuss.elastic.co/t/alias-functionality-for-percolator-index-name-so-clients-can-continue-using-alias-when-index-changes/7071/8 "2017-07-06T03:29:44Z")

</div>


