# Indexing to Alias

**URL:** <https://discuss.elastic.co/t/indexing-to-alias/10419>\
**Category:** Elasticsearch\
**Created:** [January 19, 2013, 5:20pm UTC](https://discuss.elastic.co/t/indexing-to-alias/10419 "2013-01-19T17:20:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshua](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@joshua](https://discuss.elastic.co/u/joshua)\
**Post date:** [January 19, 2013, 5:20pm UTC](https://discuss.elastic.co/t/indexing-to-alias/10419/1 "2013-01-19T17:20:01Z")

</div>

Hi again,

I'm currently on Elasticsearch 0.20.2 was curious to find ES not indexing  
any new documents when an alias points to 2 indices.

Example.

index: tweets1 -\> alias: tweets  
index: tweets2 -\> alias: tweets

In this case, I'm doing a PUT on /tweets/ and nothing gets index.

If I tried removing one the alias, which means /tweets/ would point only to  
/tweets1/ then the indexing resumes.

Not sure if this is intended or not. One reason I doing the aliasing is  
that I could make a "copy" the index for backup and experimentation, since  
ES does not support copying or remaining of indices atm i think.

Cheers,  
Joshua

--

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [January 19, 2013, 6:51pm UTC](https://discuss.elastic.co/t/indexing-to-alias/10419/2 "2013-01-19T18:51:52Z")

</div>

Hi,

As far as I know you can not index to alias pointing to more indices. That  
is expecteed.

If you want to replicate index content to another one you need to do it on  
the client side (but should be easy, look at "scroll" & "scan")

Regards,  
Lukáš  
Dne 19.1.2013 18:20 [joshua@zopim.com](mailto:joshua@zopim.com) napsal(a):

> Hi again,
> 
> I'm currently on Elasticsearch 0.20.2 was curious to find ES not indexing  
> any new documents when an alias points to 2 indices.
> 
> Example.
> 
> index: tweets1 -\> alias: tweets  
> index: tweets2 -\> alias: tweets
> 
> In this case, I'm doing a PUT on /tweets/ and nothing gets index.
> 
> If I tried removing one the alias, which means /tweets/ would point only  
> to /tweets1/ then the indexing resumes.
> 
> Not sure if this is intended or not. One reason I doing the aliasing is  
> that I could make a "copy" the index for backup and experimentation, since  
> ES does not support copying or remaining of indices atm i think.
> 
> Cheers,  
> Joshua
> 
> --

--

---

<div class="post-metadata">

**Author:** ![joshua](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@joshua](https://discuss.elastic.co/u/joshua)\
**Post date:** [January 22, 2013, 3:38am UTC](https://discuss.elastic.co/t/indexing-to-alias/10419/3 "2013-01-22T03:38:06Z")

</div>

Hi!

Thanks for the clarification.

What was unexpected as that an alias pointing to a single index allows  
indexing but an alias pointing to multiple indices do not allow. From  
a consistency point of view, that was confusing - I would rather have  
indexing be disallowed on any alias (even if its just a single index) to  
prevent the behavior of indexing on alias which may fail silently.

I have used "scroll and scan", but it does not work for my use cases -  
while source data are indexed, they are not stored, so the only way to  
recreate the index is to re-index it from the my datasource. It's not a  
really an issue, but it would be great that ES have a index  
renaming/replication function. I'm sure the speed ES does replication (like  
turning on replicas within indices) is much faster than re-indexing data  
from the client side.

Cheers,  
Joshua

On Sun, Jan 20, 2013 at 2:51 AM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:

> Hi,
> 
> As far as I know you can not index to alias pointing to more indices. That  
> is expecteed.
> 
> If you want to replicate index content to another one you need to do it on  
> the client side (but should be easy, look at "scroll" & "scan")
> 
> Regards,  
> Lukáš  
> Dne 19.1.2013 18:20 [joshua@zopim.com](mailto:joshua@zopim.com) napsal(a):
> 
> Hi again,
> 
> > I'm currently on Elasticsearch 0.20.2 was curious to find ES not indexing  
> > any new documents when an alias points to 2 indices.
> > 
> > Example.
> > 
> > index: tweets1 -\> alias: tweets  
> > index: tweets2 -\> alias: tweets
> > 
> > In this case, I'm doing a PUT on /tweets/ and nothing gets index.
> > 
> > If I tried removing one the alias, which means /tweets/ would point only  
> > to /tweets1/ then the indexing resumes.
> > 
> > Not sure if this is intended or not. One reason I doing the aliasing is  
> > that I could make a "copy" the index for backup and experimentation, since  
> > ES does not support copying or remaining of indices atm i think.
> > 
> > Cheers,  
> > Joshua
> > 
> > --
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [January 22, 2013, 9:50am UTC](https://discuss.elastic.co/t/indexing-to-alias/10419/4 "2013-01-22T09:50:31Z")

</div>

Hi,

On Tue, Jan 22, 2013 at 4:38 AM, Joshua Koo [joshua@zopim.com](mailto:joshua@zopim.com) wrote:

> Hi!
> 
> Thanks for the clarification.
> 
> What was unexpected as that an alias pointing to a single index allows  
> indexing but an alias pointing to multiple indices do not allow. From  
> a consistency point of view, that was confusing - I would rather have  
> indexing be disallowed on any alias (even if its just a single index) to  
> prevent the behavior of indexing on alias which may fail silently.

I do not think there is a reason why to disable indexing into index with a  
single alias. In fast this proved to be useful feature. For example have a  
look at rolling index plugin [1,2].

> I have used "scroll and scan", but it does not work for my use cases -  
> while source data are indexed, they are not stored, so the only way to  
> recreate the index is to re-index it from the my datasource. It's not a  
> really an issue, but it would be great that ES have a index  
> renaming/replication function. I'm sure the speed ES does replication (like  
> turning on replicas within indices) is much faster than re-indexing data  
> from the client side.

It might be a nice feature but I do not think it is available out of the  
box now. In my opinion it might make things a little bit more complex. What  
happens when you index [index in terms of mirroring] into two (or more)  
indices and the index operation fails with one of the indices? You need to  
reflect that in response or try to fix automatically?

I think it is much easier for you to do that on your side.

[1] [GitHub - karussell/elasticsearch-rollindex: ElasticSearch plugin for rolling indices.](https://github.com/karussell/elasticsearch-rollindex)  
[2]  
[Redirecting to Google Groups](https://groups.google.com/forum/#!topic/elasticsearch/Q_oufvFNEEw/discussion)

My 2 cents,  
Regards  
Lukas

--

---

<div class="post-metadata">

**Author:** ![joshua](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@joshua](https://discuss.elastic.co/u/joshua)\
**Post date:** [January 24, 2013, 5:43am UTC](https://discuss.elastic.co/t/indexing-to-alias/10419/5 "2013-01-24T05:43:26Z")

</div>

Hi Lukas,

That's an interesting plugin, and certainly I can understand the current  
behavior now. As for if multi-indices alias indexing would be supported,  
I'd think it would have a similar behavior to if there's 2 replicas for a  
index and 1 replica failed during an index operation. Of course, just my 2  
cents too 😉

Cheers,  
Joshua  
p.s. thanks for the work on bigdesk!

On Tue, Jan 22, 2013 at 5:50 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:

> Hi,
> 
> On Tue, Jan 22, 2013 at 4:38 AM, Joshua Koo [joshua@zopim.com](mailto:joshua@zopim.com) wrote:
> 
> > Hi!
> > 
> > Thanks for the clarification.
> > 
> > What was unexpected as that an alias pointing to a single index allows  
> > indexing but an alias pointing to multiple indices do not allow. From  
> > a consistency point of view, that was confusing - I would rather have  
> > indexing be disallowed on any alias (even if its just a single index) to  
> > prevent the behavior of indexing on alias which may fail silently.
> 
> I do not think there is a reason why to disable indexing into index with a  
> single alias. In fast this proved to be useful feature. For example have a  
> look at rolling index plugin [1,2].
> 
> > I have used "scroll and scan", but it does not work for my use cases -  
> > while source data are indexed, they are not stored, so the only way to  
> > recreate the index is to re-index it from the my datasource. It's not a  
> > really an issue, but it would be great that ES have a index  
> > renaming/replication function. I'm sure the speed ES does replication (like  
> > turning on replicas within indices) is much faster than re-indexing data  
> > from the client side.
> 
> It might be a nice feature but I do not think it is available out of the  
> box now. In my opinion it might make things a little bit more complex. What  
> happens when you index [index in terms of mirroring] into two (or more)  
> indices and the index operation fails with one of the indices? You need to  
> reflect that in response or try to fix automatically?
> 
> I think it is much easier for you to do that on your side.
> 
> [1] [GitHub - karussell/elasticsearch-rollindex: ElasticSearch plugin for rolling indices.](https://github.com/karussell/elasticsearch-rollindex)  
> [2]  
> [Redirecting to Google Groups](https://groups.google.com/forum/#!topic/elasticsearch/Q_oufvFNEEw/discussion)
> 
> My 2 cents,  
> Regards  
> Lukas
> 
> --

--

---

<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:54am UTC](https://discuss.elastic.co/t/indexing-to-alias/10419/6 "2017-07-06T02:54:50Z")

</div>


