Automatic index alias assigning

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatic index alias assigning

Thiago Souza
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
Reply | Threaded
Open this post in threaded view
|

Re: Automatic index alias assigning

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

On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: Automatic index alias assigning

Thiago Souza
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 <[hidden email]> wrote:
See:  http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html 


On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza <[hidden email]> 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


Reply | Threaded
Open this post in threaded view
|

Re: Automatic index alias assigning

Michael Sick
In order:
 1) create the template
 2) create the index

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 <[hidden email]> 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 <[hidden email]> wrote:
See:  http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html 


On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza <[hidden email]> 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



Reply | Threaded
Open this post in threaded view
|

Re: Automatic index alias assigning

Thiago Souza
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 <[hidden email]> wrote:
In order:
 1) create the template
 2) create the index

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 <[hidden email]> 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 <[hidden email]> wrote:
See:  http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html 


On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza <[hidden email]> 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




Reply | Threaded
Open this post in threaded view
|

Re: Automatic index alias assigning

Michael Sick
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 <[hidden email]> 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 <[hidden email]> wrote:
In order:
 1) create the template
 2) create the index

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 <[hidden email]> 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 <[hidden email]> wrote:
See:  http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html 


On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza <[hidden email]> 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





Reply | Threaded
Open this post in threaded view
|

Re: Automatic index alias assigning

Thiago Souza
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
In order:
 1) create the template
 2) create the index

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 <[hidden email]> 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 <[hidden email]> wrote:
See:  http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html 


On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza <[hidden email]> 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






Reply | Threaded
Open this post in threaded view
|

Re: Automatic index alias assigning

Rossini
+1 
That would be great.

On Wed, Mar 28, 2012 at 4:45 PM, Thiago Souza <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
In order:
 1) create the template
 2) create the index

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 <[hidden email]> 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 <[hidden email]> wrote:
See:  http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html 


On Wed, Mar 28, 2012 at 11:15 AM, Thiago Souza <[hidden email]> 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