# Define index alias in template

**URL:** <https://discuss.elastic.co/t/define-index-alias-in-template/4214>\
**Category:** Elasticsearch\
**Created:** [April 11, 2011, 5:00pm UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214 "2011-04-11T17:00:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [April 11, 2011, 5:00pm UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214/1 "2011-04-11T17:00:28Z")

</div>

Hi there,

```
   Does anyone knows if it's possible to define an index alias at index

```

template level?

Thanks,  
Thiago Souza

---

<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:** [April 11, 2011, 6:05pm UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214/2 "2011-04-11T18:05:34Z")

</div>

No. You can define the alias either when creating the index, or using the alias API.  
On Monday, April 11, 2011 at 8:00 PM, Thiago Souza wrote:

> Hi there,
> 
> Does anyone knows if it's possible to define an index alias at index template level?
> 
> Thanks,  
> Thiago Souza

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [April 11, 2011, 6:25pm UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214/3 "2011-04-11T18:25:39Z")

</div>

Hi Shay,

```
   May I open an issue with this as a feature request?

```

Regards,  
Thiago Souza

On Mon, Apr 11, 2011 at 15:05, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> No. You can define the alias either when creating the index, or using the  
> alias API.
> 
> On Monday, April 11, 2011 at 8:00 PM, Thiago Souza wrote:
> 
> Hi there,
> 
> ```
> Does anyone knows if it's possible to define an index alias at index
> 
> ```
> 
> template level?
> 
> Thanks,  
> Thiago Souza

---

<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:** [April 11, 2011, 6:32pm UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214/4 "2011-04-11T18:32:40Z")

</div>

I am going to revisit the whole alias feature in the next version (post 0.16), what exactly do you need it for? Create indices that all will share the same alias? That alias will only make sense then when searching...  
On Monday, April 11, 2011 at 9:25 PM, Thiago Souza wrote:

> Hi Shay,
> 
> May I open an issue with this as a feature request?
> 
> Regards,  
> Thiago Souza
> 
> On Mon, Apr 11, 2011 at 15:05, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > No. You can define the alias either when creating the index, or using the alias API.  
> > On Monday, April 11, 2011 at 8:00 PM, Thiago Souza wrote:
> > 
> > > Hi there,
> > > 
> > > Does anyone knows if it's possible to define an index alias at index template level?
> > > 
> > > Thanks,  
> > > Thiago Souza

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [April 11, 2011, 6:42pm UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214/5 "2011-04-11T18:42:54Z")

</div>

Hi Shay,

```
Currently I'm build a tweet processing system based on elasticsearch.
What I am planning to do is to create a daily index of tweets with a

```

dynamic name (i.e. "tweet---") and each created index will  
be assigned to a static alias name (i.e. tweet).  
So, I'm planning on creating a "tweet-\*" index template and it would be  
really nice if it could automatically be assigned to the static alias name  
"tweet". Currently I need a separate logic/process to make this assignment.

Regards,  
Thiago Souza

On Mon, Apr 11, 2011 at 15:32, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> I am going to revisit the whole alias feature in the next version (post  
> 0.16), what exactly do you need it for? Create indices that all will share  
> the same alias? That alias will only make sense then when searching...
> 
> On Monday, April 11, 2011 at 9:25 PM, Thiago Souza wrote:
> 
> Hi Shay,
> 
> ```
> May I open an issue with this as a feature request?
> 
> ```
> 
> Regards,  
> Thiago Souza
> 
> On Mon, Apr 11, 2011 at 15:05, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> No. You can define the alias either when creating the index, or using the  
> alias API.
> 
> On Monday, April 11, 2011 at 8:00 PM, Thiago Souza wrote:
> 
> Hi there,
> 
> ```
> Does anyone knows if it's possible to define an index alias at index
> 
> ```
> 
> template level?
> 
> Thanks,  
> Thiago Souza

---

<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:** [April 11, 2011, 6:47pm UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214/6 "2011-04-11T18:47:20Z")

</div>

You can set in the index template part a setting called index.aliases and set it to the alias name. This should work.  
On Monday, April 11, 2011 at 9:42 PM, Thiago Souza wrote:

> Hi Shay,
> 
> Currently I'm build a tweet processing system based on elasticsearch.  
> What I am planning to do is to create a daily index of tweets with a dynamic name (i.e. "tweet---") and each created index will be assigned to a static alias name (i.e. tweet).  
> So, I'm planning on creating a "tweet-\*" index template and it would be really nice if it could automatically be assigned to the static alias name "tweet". Currently I need a separate logic/process to make this assignment.
> 
> Regards,  
> Thiago Souza
> 
> On Mon, Apr 11, 2011 at 15:32, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > I am going to revisit the whole alias feature in the next version (post 0.16), what exactly do you need it for? Create indices that all will share the same alias? That alias will only make sense then when searching...  
> > On Monday, April 11, 2011 at 9:25 PM, Thiago Souza wrote:
> > 
> > > Hi Shay,
> > > 
> > > May I open an issue with this as a feature request?
> > > 
> > > Regards,  
> > > Thiago Souza
> > > 
> > > On Mon, Apr 11, 2011 at 15:05, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > > 
> > > > No. You can define the alias either when creating the index, or using the alias API.  
> > > > On Monday, April 11, 2011 at 8:00 PM, Thiago Souza wrote:
> > > > 
> > > > > Hi there,
> > > > > 
> > > > > Does anyone knows if it's possible to define an index alias at index template level?
> > > > > 
> > > > > Thanks,  
> > > > > Thiago Souza

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [April 11, 2011, 6:54pm UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214/7 "2011-04-11T18:54:56Z")

</div>

Great!

On Mon, Apr 11, 2011 at 15:47, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> You can set in the index template part a setting called index.aliases and  
> set it to the alias name. This should work.
> 
> On Monday, April 11, 2011 at 9:42 PM, Thiago Souza wrote:
> 
> Hi Shay,
> 
> ```
> Currently I'm build a tweet processing system based on elasticsearch.
> What I am planning to do is to create a daily index of tweets with a
> 
> ```
> 
> dynamic name (i.e. "tweet---") and each created index will  
> be assigned to a static alias name (i.e. tweet).  
> So, I'm planning on creating a "tweet-\*" index template and it would be  
> really nice if it could automatically be assigned to the static alias name  
> "tweet". Currently I need a separate logic/process to make this assignment.
> 
> Regards,  
> Thiago Souza
> 
> On Mon, Apr 11, 2011 at 15:32, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> I am going to revisit the whole alias feature in the next version (post  
> 0.16), what exactly do you need it for? Create indices that all will share  
> the same alias? That alias will only make sense then when searching...
> 
> On Monday, April 11, 2011 at 9:25 PM, Thiago Souza wrote:
> 
> Hi Shay,
> 
> ```
> May I open an issue with this as a feature request?
> 
> ```
> 
> Regards,  
> Thiago Souza
> 
> On Mon, Apr 11, 2011 at 15:05, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:
> 
> No. You can define the alias either when creating the index, or using the  
> alias API.
> 
> On Monday, April 11, 2011 at 8:00 PM, Thiago Souza wrote:
> 
> Hi there,
> 
> ```
> Does anyone knows if it's possible to define an index alias at index
> 
> ```
> 
> template level?
> 
> Thanks,  
> Thiago Souza

---

<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, 4:08am UTC](https://discuss.elastic.co/t/define-index-alias-in-template/4214/8 "2017-07-06T04:08:32Z")

</div>


