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


(Nakul Jhalani) #1

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!


(Shay Banon) #2

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.comwrote:

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!


(Nakul Jhalani) #3

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!


(Shay Banon) #4

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.comwrote:

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!


(Onilton Maciel) #5

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 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.comwrote:

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!


(Nakul Jhalani) #6

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 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.comwrote:

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!


(Shay Banon) #7

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.comwrote:

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 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
**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!


(system) #8