Automatic index alias assigning


(Thiago Souza) #1

Hello all,

     Is there any way to automatically assign and index alias upon it's

creation, based on a pattern
For example, twitter-* => twitter and so upon creation of
"twitter-2012-03-28" would be automatically assigned to "twitter"

Cheers,
Thiago Souza


(Michael Sick) #2

See:
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza tcostasouza@gmail.comwrote:

Hello all,

     Is there any way to automatically assign and index alias upon

it's creation, based on a pattern
For example, twitter-* => twitter and so upon creation of
"twitter-2012-03-28" would be automatically assigned to "twitter"

Cheers,
Thiago Souza


(Thiago Souza) #3

Hi Michael,

 This is great! But how do I set the alias? I can find de documentation

on how to add an index alias, but when setting up a new index, how to
declare the aliases?

Cheers

On Wed, Mar 28, 2012 at 12:18, Michael Sick <michael.sick@serenesoftware.com

wrote:

See:
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza tcostasouza@gmail.comwrote:

Hello all,

     Is there any way to automatically assign and index alias upon

it's creation, based on a pattern
For example, twitter-* => twitter and so upon creation of
"twitter-2012-03-28" would be automatically assigned to "twitter"

Cheers,
Thiago Souza


(Michael Sick) #4

In order:

  1. create the template
  2. create the index
  3. create the alias (
    http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.html)

you can then redefine the alias as your data changes over time. People
often use the alias function when doing time based indices.
--Mike

On Wed, Mar 28, 2012 at 1:54 PM, Thiago Souza tcostasouza@gmail.com wrote:

Hi Michael,

 This is great! But how do I set the alias? I can find de

documentation on how to add an index alias, but when setting up a new
index, how to declare the aliases?

Cheers

On Wed, Mar 28, 2012 at 12:18, Michael Sick <
michael.sick@serenesoftware.com> wrote:

See:
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza tcostasouza@gmail.comwrote:

Hello all,

     Is there any way to automatically assign and index alias upon

it's creation, based on a pattern
For example, twitter-* => twitter and so upon creation of
"twitter-2012-03-28" would be automatically assigned to "twitter"

Cheers,
Thiago Souza


(Thiago Souza) #5

Michael,

The index is created automatically (i.e. a document is indexed into non
existing idex), how can I create the alias, automatically, right after the
index creation?

Cheers

On Wed, Mar 28, 2012 at 15:14, Michael Sick <michael.sick@serenesoftware.com

wrote:

In order:

  1. create the template
  2. create the index
  3. create the alias (
    http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.html
    )

you can then redefine the alias as your data changes over time. People
often use the alias function when doing time based indices.
--Mike

On Wed, Mar 28, 2012 at 1:54 PM, Thiago Souza tcostasouza@gmail.comwrote:

Hi Michael,

 This is great! But how do I set the alias? I can find de

documentation on how to add an index alias, but when setting up a new
index, how to declare the aliases?

Cheers

On Wed, Mar 28, 2012 at 12:18, Michael Sick <
michael.sick@serenesoftware.com> wrote:

See:
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza tcostasouza@gmail.comwrote:

Hello all,

     Is there any way to automatically assign and index alias upon

it's creation, based on a pattern
For example, twitter-* => twitter and so upon creation of
"twitter-2012-03-28" would be automatically assigned to "twitter"

Cheers,
Thiago Souza


(Michael Sick) #6

Ahh - no idea offhand. I have done all of my index creation intentionally.
I know that ES provides information/API's on its inner workings and that
people are creating plugins that listen to these API's for various reasons.
I imagine you could listen for such an event and fire the alias command.
Are you set on allowing lazy creation of the indices?

On Wed, Mar 28, 2012 at 3:08 PM, Thiago Souza tcostasouza@gmail.com wrote:

Michael,

The index is created automatically (i.e. a document is indexed into non
existing idex), how can I create the alias, automatically, right after the
index creation?

Cheers

On Wed, Mar 28, 2012 at 15:14, Michael Sick <
michael.sick@serenesoftware.com> wrote:

In order:

  1. create the template
  2. create the index
  3. create the alias (
    http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.html
    )

you can then redefine the alias as your data changes over time. People
often use the alias function when doing time based indices.
--Mike

On Wed, Mar 28, 2012 at 1:54 PM, Thiago Souza tcostasouza@gmail.comwrote:

Hi Michael,

 This is great! But how do I set the alias? I can find de

documentation on how to add an index alias, but when setting up a new
index, how to declare the aliases?

Cheers

On Wed, Mar 28, 2012 at 12:18, Michael Sick <
michael.sick@serenesoftware.com> wrote:

See:
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza tcostasouza@gmail.comwrote:

Hello all,

     Is there any way to automatically assign and index alias upon

it's creation, based on a pattern
For example, twitter-* => twitter and so upon creation of
"twitter-2012-03-28" would be automatically assigned to "twitter"

Cheers,
Thiago Souza


(Thiago Souza) #7

Michael,

I thought on creating a plugin myself, just wondering if there already

wasn't a way of doing it. IMO setting index alias on index templating is
perfect. I think I'll fire a feature request for this...

Cheers

On Wed, Mar 28, 2012 at 16:38, Michael Sick <michael.sick@serenesoftware.com

wrote:

Ahh - no idea offhand. I have done all of my index creation intentionally.
I know that ES provides information/API's on its inner workings and that
people are creating plugins that listen to these API's for various reasons.
I imagine you could listen for such an event and fire the alias command.
Are you set on allowing lazy creation of the indices?

On Wed, Mar 28, 2012 at 3:08 PM, Thiago Souza tcostasouza@gmail.comwrote:

Michael,

The index is created automatically (i.e. a document is indexed into
non existing idex), how can I create the alias, automatically, right after
the index creation?

Cheers

On Wed, Mar 28, 2012 at 15:14, Michael Sick <
michael.sick@serenesoftware.com> wrote:

In order:

  1. create the template
  2. create the index
  3. create the alias (
    http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.html
    )

you can then redefine the alias as your data changes over time. People
often use the alias function when doing time based indices.
--Mike

On Wed, Mar 28, 2012 at 1:54 PM, Thiago Souza tcostasouza@gmail.comwrote:

Hi Michael,

 This is great! But how do I set the alias? I can find de

documentation on how to add an index alias, but when setting up a new
index, how to declare the aliases?

Cheers

On Wed, Mar 28, 2012 at 12:18, Michael Sick <
michael.sick@serenesoftware.com> wrote:

See:
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza tcostasouza@gmail.comwrote:

Hello all,

     Is there any way to automatically assign and index alias

upon it's creation, based on a pattern
For example, twitter-* => twitter and so upon creation of
"twitter-2012-03-28" would be automatically assigned to "twitter"

Cheers,
Thiago Souza


(Rossini) #8

+1
That would be great.

On Wed, Mar 28, 2012 at 4:45 PM, Thiago Souza tcostasouza@gmail.com wrote:

Michael,

I thought on creating a plugin myself, just wondering if there already

wasn't a way of doing it. IMO setting index alias on index templating is
perfect. I think I'll fire a feature request for this...

Cheers

On Wed, Mar 28, 2012 at 16:38, Michael Sick <
michael.sick@serenesoftware.com> wrote:

Ahh - no idea offhand. I have done all of my index creation
intentionally. I know that ES provides information/API's on its inner
workings and that people are creating plugins that listen to these API's
for various reasons. I imagine you could listen for such an event and fire
the alias command. Are you set on allowing lazy creation of the indices?

On Wed, Mar 28, 2012 at 3:08 PM, Thiago Souza tcostasouza@gmail.comwrote:

Michael,

The index is created automatically (i.e. a document is indexed into
non existing idex), how can I create the alias, automatically, right after
the index creation?

Cheers

On Wed, Mar 28, 2012 at 15:14, Michael Sick <
michael.sick@serenesoftware.com> wrote:

In order:

  1. create the template
  2. create the index
  3. create the alias (
    http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.html
    )

you can then redefine the alias as your data changes over time. People
often use the alias function when doing time based indices.
--Mike

On Wed, Mar 28, 2012 at 1:54 PM, Thiago Souza tcostasouza@gmail.comwrote:

Hi Michael,

 This is great! But how do I set the alias? I can find de

documentation on how to add an index alias, but when setting up a new
index, how to declare the aliases?

Cheers

On Wed, Mar 28, 2012 at 12:18, Michael Sick <
michael.sick@serenesoftware.com> wrote:

See:
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza <tcostasouza@gmail.com

wrote:

Hello all,

     Is there any way to automatically assign and index alias

upon it's creation, based on a pattern
For example, twitter-* => twitter and so upon creation of
"twitter-2012-03-28" would be automatically assigned to "twitter"

Cheers,
Thiago Souza


#9

I'm trying to do the same thing with time based data. Is this now supported in index templates?
[Edit] Sorry to bump this - I found a more recent conversation on this here: https://github.com/elastic/elasticsearch/issues/5359


(system) #10