# Index alias

**URL:** <https://discuss.elastic.co/t/index-alias/6471>\
**Category:** Elasticsearch\
**Created:** [January 23, 2012, 9:10pm UTC](https://discuss.elastic.co/t/index-alias/6471 "2012-01-23T21:10:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![derrickburns](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@derrickburns](https://discuss.elastic.co/u/derrickburns)\
**Post date:** [January 23, 2012, 9:10pm UTC](https://discuss.elastic.co/t/index-alias/6471/1 "2012-01-23T21:10:55Z")

</div>

Can an index alias refer to other aliases (as long as a cycle is not  
introduced)?

---

<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:** [January 23, 2012, 9:16pm UTC](https://discuss.elastic.co/t/index-alias/6471/2 "2012-01-23T21:16:31Z")

</div>

No, it can only point to an index...

On Mon, Jan 23, 2012 at 11:10 PM, Derrick [derrickrburns@gmail.com](mailto:derrickrburns@gmail.com) wrote:

> Can an index alias refer to other aliases (as long as a cycle is not  
> introduced)?

---

<div class="post-metadata">

**Author:** ![derrickburns](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@derrickburns](https://discuss.elastic.co/u/derrickburns)\
**Post date:** [January 23, 2012, 10:45pm UTC](https://discuss.elastic.co/t/index-alias/6471/3 "2012-01-23T22:45:09Z")

</div>

That's too bad. Here is my need:

I want to offer real time searches on time based data. I implement that  
with using a set of indices. One index holds "recent" data, which the  
other indices hold "older" data. A single alias pointing to the concrete  
indices would work just fine, except ...

To avoid the need to synchronize data movement between the recent and the  
older indices, some of the data in the "recent" index is replicated in the  
"older" indices. Therefore, to avoid getting back duplicate results, I  
filter the data. Your filtered alias feature looks like a perfect fit. But  
I need different filters on the recent index and the older indices.

I suppose that I could update the TTL value dynamically on the recent index  
as data is added to the older indices. This presumes that a document that  
exceeds the TTL value won't be returned in a search. However, this would  
require synchronization between the two set of indices, which, as I said, I  
would like to avoid.

So, I was hoping that I could have a single alias "all" which would refer  
to the "recent" filtered alias and the "older" filtered alias.

---

<div class="post-metadata">

**Author:** ![Berkay\_Mollamustafao](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Berkay\_Mollamustafao](https://discuss.elastic.co/u/Berkay_Mollamustafao)\
**Post date:** [January 23, 2012, 11:12pm UTC](https://discuss.elastic.co/t/index-alias/6471/4 "2012-01-23T23:12:04Z")

</div>

You can search through multiple indices together. Would that not help?

Regards,  
Berkay Mollamustafaoglu  
mberkay on yahoo, google and skype

On Mon, Jan 23, 2012 at 5:45 PM, Derrick [derrickrburns@gmail.com](mailto:derrickrburns@gmail.com) wrote:

> That's too bad. Here is my need:
> 
> I want to offer real time searches on time based data. I implement that  
> with using a set of indices. One index holds "recent" data, which the  
> other indices hold "older" data. A single alias pointing to the concrete  
> indices would work just fine, except ...
> 
> To avoid the need to synchronize data movement between the recent and the  
> older indices, some of the data in the "recent" index is replicated in the  
> "older" indices. Therefore, to avoid getting back duplicate results, I  
> filter the data. Your filtered alias feature looks like a perfect fit. But  
> I need different filters on the recent index and the older indices.
> 
> I suppose that I could update the TTL value dynamically on the recent  
> index as data is added to the older indices. This presumes that a  
> document that exceeds the TTL value won't be returned in a search.  
> However, this would require synchronization between the two set of  
> indices, which, as I said, I would like to avoid.
> 
> So, I was hoping that I could have a single alias "all" which would refer  
> to the "recent" filtered alias and the "older" filtered alias.

---

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [January 23, 2012, 11:12pm UTC](https://discuss.elastic.co/t/index-alias/6471/5 "2012-01-23T23:12:53Z")

</div>

Derrick,

Why not have a few aliases and time slice your data indexes a little more  
narrowly to avoid having to migrate the data? If you have say an index per  
day you can alias each day's data to an alias for 'today', 'recent', and  
'old'. If you choose this approach, take a look at index templates to make  
it easy. Hope that helps.

--Mike

On Mon, Jan 23, 2012 at 5:45 PM, Derrick [derrickrburns@gmail.com](mailto:derrickrburns@gmail.com) wrote:

> That's too bad. Here is my need:
> 
> I want to offer real time searches on time based data. I implement that  
> with using a set of indices. One index holds "recent" data, which the  
> other indices hold "older" data. A single alias pointing to the concrete  
> indices would work just fine, except ...
> 
> To avoid the need to synchronize data movement between the recent and the  
> older indices, some of the data in the "recent" index is replicated in the  
> "older" indices. Therefore, to avoid getting back duplicate results, I  
> filter the data. Your filtered alias feature looks like a perfect fit. But  
> I need different filters on the recent index and the older indices.
> 
> I suppose that I could update the TTL value dynamically on the recent  
> index as data is added to the older indices. This presumes that a  
> document that exceeds the TTL value won't be returned in a search.  
> However, this would require synchronization between the two set of  
> indices, which, as I said, I would like to avoid.
> 
> So, I was hoping that I could have a single alias "all" which would refer  
> to the "recent" filtered alias and the "older" filtered alias.

---

<div class="post-metadata">

**Author:** ![derrickburns](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@derrickburns](https://discuss.elastic.co/u/derrickburns)\
**Post date:** [January 23, 2012, 11:27pm UTC](https://discuss.elastic.co/t/index-alias/6471/6 "2012-01-23T23:27:47Z")

</div>

Duhhh, search on the two filtered aliases! I am slow today!

Thx

---

<div class="post-metadata">

**Author:** ![dib\_g](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dib\_g](https://discuss.elastic.co/u/dib_g)\
**Post date:** [November 6, 2013, 12:39am UTC](https://discuss.elastic.co/t/index-alias/6471/7 "2013-11-06T00:39:23Z")

</div>

Ho,

I have a similar need from ElasticSearch (v0.90.5). I am indexing logs on a monthly basis e.g. one index per month. So lets say I have the following indices: flume-01-13, flume-02-13, flume-03-13, .... flume-11-13.

I want to create an alias, say current\_alias that will point to indices created 3 months from the current month meaning flume-11-13, flume-10-2013, flume-09-2013 in the month of Nov,2013 and will be pointing to flume-12-13, flume-11-2013 and flume-10-2013 in Dec, 2013 and so on.

Is there any way of creating aliases which are dynamic and can be set by matching some rule / regex?

Thanks,

- Dib

---

<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, 2:08am UTC](https://discuss.elastic.co/t/index-alias/6471/8 "2017-07-06T02:08:38Z")

</div>


