# Alias for types

**URL:** <https://discuss.elastic.co/t/alias-for-types/5244>\
**Category:** Elasticsearch\
**Created:** [August 24, 2011, 8:30pm UTC](https://discuss.elastic.co/t/alias-for-types/5244 "2011-08-24T20:30:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will\_Ezell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/will_ezell/32/2960_2.png) [@Will\_Ezell](https://discuss.elastic.co/u/Will_Ezell)\
**Post date:** [August 24, 2011, 8:30pm UTC](https://discuss.elastic.co/t/alias-for-types/5244/1 "2011-08-24T20:30:56Z")

</div>

Ok, so the index aliasing feature is really cool and powerful. I was  
wondering if there is any similar sort of functionality for types? The use  
case is this - you have 100,000 news articles and 100,000 tweets indexed. I  
want to change the mapping on the news articles (index a new field) and do a  
reindex of just news articles into the new mapping. Is there a way to alias  
these so that you could atomically cut from a query on the old type to a  
query on the new type without having to rewrite the queries?

By the way Shay, amazing work. And not even just in code, though what is  
there is really elegant, but with the whole project - the releases, the site  
maintenance, responsiveness on the listserv, the whole bucket. Hats off.

Will

* * *

Will Ezell

> **[Content Management System (CMS)](https://www.dotcms.com/)**
>
> dotCMS is a powerful content management system (CMS) that enables efficient creation, management, and delivery of digital content across various platforms, facilitating seamless web experiences.

phone: 305.858.1422 ext. 286  
direct: (978) 294-9429 [https://www.google.com/voice/b/0?pli=1#phones](https://www.google.com/voice/b/0?pli=1#phones)  
skype: wezell1

On Wed, Aug 24, 2011 at 4:17 PM, Sebastian [sgavarini@gmail.com](mailto:sgavarini@gmail.com) wrote:

> Hi,
> 
> I was thinking in using JMX monitoring to plot some data, like index  
> size, doc. count, translog ops, etc. The problem I am having is that  
> only the indices names are shown under "org.elasticsearch/indices",  
> not the aliases, so it's impossible to add an agent request for that  
> index, as the name changes from time to time (when I do a full reindex  
> for example, as I increment the index version and swap the alias  
> later). Also the caches status would be a nice JMX addition.
> 
> I think it must be somewhere in the roadmap, meanwhile I can implement  
> myself an MBean using the status API and the like, but I would like to  
> know if you are planning to add it soon so I won't waste time in it  
> now.
> 
> Thanks,  
> Sebastian.

---

<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:** [August 24, 2011, 10:53pm UTC](https://discuss.elastic.co/t/alias-for-types/5244/2 "2011-08-24T22:53:30Z")

</div>

First of all, thanks! :). Regarding alias for types, I think that if you  
want to solve the scenario you mentioned, it might make sense to have the  
two types as different indices. This will allow you to easily reindex only a  
specific "type" (which is now an index), deleting an index is much more  
lightweight compared to deleting a type (and all its docs), and, you can  
alway search across indices.

On Wed, Aug 24, 2011 at 11:30 PM, Will Ezell [will@dotcms.com](mailto:will@dotcms.com) wrote:

> Ok, so the index aliasing feature is really cool and powerful. I was  
> wondering if there is any similar sort of functionality for types? The use  
> case is this - you have 100,000 news articles and 100,000 tweets indexed. I  
> want to change the mapping on the news articles (index a new field) and do a  
> reindex of just news articles into the new mapping. Is there a way to alias  
> these so that you could atomically cut from a query on the old type to a  
> query on the new type without having to rewrite the queries?
> 
> By the way Shay, amazing work. And not even just in code, though what is  
> there is really elegant, but with the whole project - the releases, the site  
> maintenance, responsiveness on the listserv, the whole bucket. Hats off.
> 
> Will
> 
> * * *
> 
> Will Ezell  
> [http://dotcms.com](http://dotcms.com)  
> phone: 305.858.1422 ext. 286  
> direct: (978) 294-9429 [https://www.google.com/voice/b/0?pli=1#phones](https://www.google.com/voice/b/0?pli=1#phones)  
> skype: wezell1
> 
> On Wed, Aug 24, 2011 at 4:17 PM, Sebastian [sgavarini@gmail.com](mailto:sgavarini@gmail.com) wrote:
> 
> > Hi,
> > 
> > I was thinking in using JMX monitoring to plot some data, like index  
> > size, doc. count, translog ops, etc. The problem I am having is that  
> > only the indices names are shown under "org.elasticsearch/indices",  
> > not the aliases, so it's impossible to add an agent request for that  
> > index, as the name changes from time to time (when I do a full reindex  
> > for example, as I increment the index version and swap the alias  
> > later). Also the caches status would be a nice JMX addition.
> > 
> > I think it must be somewhere in the roadmap, meanwhile I can implement  
> > myself an MBean using the status API and the like, but I would like to  
> > know if you are planning to add it soon so I won't waste time in it  
> > now.
> > 
> > Thanks,  
> > Sebastian.

---

<div class="post-metadata">

**Author:** ![Will\_Ezell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/will_ezell/32/2960_2.png) [@Will\_Ezell](https://discuss.elastic.co/u/Will_Ezell)\
**Post date:** [August 25, 2011, 10:50am UTC](https://discuss.elastic.co/t/alias-for-types/5244/3 "2011-08-25T10:50:21Z")

</div>

Sorry, my example was not complete. One type per index was my first thought  
too - but my issue is that there can be 100's of types which would mean  
100's of indexes. Knowing a little about lucene and OS resource  
consumption, I was wary of this approach. Maybe we do the type alias idea  
in code and just translate to ES or should I not be scared of the 1 index  
per type idea?

Will

* * *

Will Ezell

> **[Content Management System (CMS)](https://www.dotcms.com/)**
>
> dotCMS is a powerful content management system (CMS) that enables efficient creation, management, and delivery of digital content across various platforms, facilitating seamless web experiences.

phone: 305.858.1422 ext. 286  
direct: (978) 294-9429 [https://www.google.com/voice/b/0?pli=1#phones](https://www.google.com/voice/b/0?pli=1#phones)  
skype: wezell1

On Wed, Aug 24, 2011 at 6:53 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> First of all, thanks! :). Regarding alias for types, I think that if you  
> want to solve the scenario you mentioned, it might make sense to have the  
> two types as different indices. This will allow you to easily reindex only a  
> specific "type" (which is now an index), deleting an index is much more  
> lightweight compared to deleting a type (and all its docs), and, you can  
> alway search across indices.
> 
> On Wed, Aug 24, 2011 at 11:30 PM, Will Ezell [will@dotcms.com](mailto:will@dotcms.com) wrote:
> 
> > Ok, so the index aliasing feature is really cool and powerful. I was  
> > wondering if there is any similar sort of functionality for types? The use  
> > case is this - you have 100,000 news articles and 100,000 tweets indexed. I  
> > want to change the mapping on the news articles (index a new field) and do a  
> > reindex of just news articles into the new mapping. Is there a way to alias  
> > these so that you could atomically cut from a query on the old type to a  
> > query on the new type without having to rewrite the queries?
> > 
> > By the way Shay, amazing work. And not even just in code, though what is  
> > there is really elegant, but with the whole project - the releases, the site  
> > maintenance, responsiveness on the listserv, the whole bucket. Hats off.
> > 
> > Will
> > 
> > * * *
> > 
> > Will Ezell  
> > [http://dotcms.com](http://dotcms.com)  
> > phone: 305.858.1422 ext. 286  
> > direct: (978) 294-9429 [https://www.google.com/voice/b/0?pli=1#phones](https://www.google.com/voice/b/0?pli=1#phones)  
> > skype: wezell1
> > 
> > On Wed, Aug 24, 2011 at 4:17 PM, Sebastian [sgavarini@gmail.com](mailto:sgavarini@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I was thinking in using JMX monitoring to plot some data, like index  
> > > size, doc. count, translog ops, etc. The problem I am having is that  
> > > only the indices names are shown under "org.elasticsearch/indices",  
> > > not the aliases, so it's impossible to add an agent request for that  
> > > index, as the name changes from time to time (when I do a full reindex  
> > > for example, as I increment the index version and swap the alias  
> > > later). Also the caches status would be a nice JMX addition.
> > > 
> > > I think it must be somewhere in the roadmap, meanwhile I can implement  
> > > myself an MBean using the status API and the like, but I would like to  
> > > know if you are planning to add it soon so I won't waste time in it  
> > > now.
> > > 
> > > Thanks,  
> > > Sebastian.

---

<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:** [August 26, 2011, 3:00pm UTC](https://discuss.elastic.co/t/alias-for-types/5244/4 "2011-08-26T15:00:36Z")

</div>

An index per type will require more resources, you can try and reduce that  
by using less shards per index, but even with 1 shard per index, on a single  
node, that does mean 100s of shards on a node. Stil something that is  
doable, but you will need to test it (I know of people doing it).

If not, then I suggest doing it on the client side for now. Its tricky to  
implement now in elasticsearch.

On Thu, Aug 25, 2011 at 1:50 PM, Will Ezell [will@dotcms.com](mailto:will@dotcms.com) wrote:

> Sorry, my example was not complete. One type per index was my first  
> thought too - but my issue is that there can be 100's of types which would  
> mean 100's of indexes. Knowing a little about lucene and OS resource  
> consumption, I was wary of this approach. Maybe we do the type alias idea  
> in code and just translate to ES or should I not be scared of the 1 index  
> per type idea?
> 
> Will
> 
> * * *
> 
> Will Ezell  
> [http://dotcms.com](http://dotcms.com)  
> phone: 305.858.1422 ext. 286  
> direct: (978) 294-9429 [https://www.google.com/voice/b/0?pli=1#phones](https://www.google.com/voice/b/0?pli=1#phones)  
> skype: wezell1
> 
> On Wed, Aug 24, 2011 at 6:53 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > First of all, thanks! :). Regarding alias for types, I think that if you  
> > want to solve the scenario you mentioned, it might make sense to have the  
> > two types as different indices. This will allow you to easily reindex only a  
> > specific "type" (which is now an index), deleting an index is much more  
> > lightweight compared to deleting a type (and all its docs), and, you can  
> > alway search across indices.
> > 
> > On Wed, Aug 24, 2011 at 11:30 PM, Will Ezell [will@dotcms.com](mailto:will@dotcms.com) wrote:
> > 
> > > Ok, so the index aliasing feature is really cool and powerful. I was  
> > > wondering if there is any similar sort of functionality for types? The use  
> > > case is this - you have 100,000 news articles and 100,000 tweets indexed. I  
> > > want to change the mapping on the news articles (index a new field) and do a  
> > > reindex of just news articles into the new mapping. Is there a way to alias  
> > > these so that you could atomically cut from a query on the old type to a  
> > > query on the new type without having to rewrite the queries?
> > > 
> > > By the way Shay, amazing work. And not even just in code, though what is  
> > > there is really elegant, but with the whole project - the releases, the site  
> > > maintenance, responsiveness on the listserv, the whole bucket. Hats off.
> > > 
> > > Will
> > > 
> > > * * *
> > > 
> > > Will Ezell  
> > > [http://dotcms.com](http://dotcms.com)  
> > > phone: 305.858.1422 ext. 286  
> > > direct: (978) 294-9429 [https://www.google.com/voice/b/0?pli=1#phones](https://www.google.com/voice/b/0?pli=1#phones)  
> > > skype: wezell1
> > > 
> > > On Wed, Aug 24, 2011 at 4:17 PM, Sebastian [sgavarini@gmail.com](mailto:sgavarini@gmail.com) wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I was thinking in using JMX monitoring to plot some data, like index  
> > > > size, doc. count, translog ops, etc. The problem I am having is that  
> > > > only the indices names are shown under "org.elasticsearch/indices",  
> > > > not the aliases, so it's impossible to add an agent request for that  
> > > > index, as the name changes from time to time (when I do a full reindex  
> > > > for example, as I increment the index version and swap the alias  
> > > > later). Also the caches status would be a nice JMX addition.
> > > > 
> > > > I think it must be somewhere in the roadmap, meanwhile I can implement  
> > > > myself an MBean using the status API and the like, but I would like to  
> > > > know if you are planning to add it soon so I won't waste time in it  
> > > > now.
> > > > 
> > > > Thanks,  
> > > > Sebastian.

---

<div class="post-metadata">

**Author:** ![stalinist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stalinist/32/1143_2.png) [@stalinist](https://discuss.elastic.co/u/stalinist)\
**Post date:** [October 29, 2014, 5:23pm UTC](https://discuss.elastic.co/t/alias-for-types/5244/5 "2014-10-29T17:23:52Z")

</div>

Is this still actual?  
Did not find aliases for types...

---

<div class="post-metadata">

**Author:** ![MichaelBrenden](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@MichaelBrenden](https://discuss.elastic.co/u/MichaelBrenden)\
**Post date:** [March 13, 2017, 7:49pm UTC](https://discuss.elastic.co/t/alias-for-types/5244/6 "2017-03-13T19:49:04Z")

</div>

Curious to know same -- can types be aliased ?

[http://server:9200/index\_name/index\_type/\_aliases](http://server:9200/index_name/index_type/_aliases)

---

<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 5, 2017, 10:02pm UTC](https://discuss.elastic.co/t/alias-for-types/5244/7 "2017-07-05T22:02:20Z")

</div>


