# Adding indces to alies and routing

**URL:** <https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136>\
**Category:** Elasticsearch\
**Created:** [December 20, 2012, 7:02pm UTC](https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136 "2012-12-20T19:02:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexis\_Okuwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexis_okuwa/32/1983_2.png) [@Alexis\_Okuwa](https://discuss.elastic.co/u/Alexis_Okuwa)\
**Post date:** [December 20, 2012, 7:02pm UTC](https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136/1 "2012-12-20T19:02:57Z")

</div>

A month ago I asked a question about sharding and routuing and so on. You  
can find it  
here. [https://github.com/elasticsearch/elasticsearch/issues/2443](https://github.com/elasticsearch/elasticsearch/issues/2443) I am  
woundering if i create indexes with a single shard, and then add those  
indexes to an alies and then i query and insert into the alies, and I use  
routing, will my routing get messed up everytime i add a new index to the  
route?

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [December 20, 2012, 9:48pm UTC](https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136/2 "2012-12-20T21:48:40Z")

</div>

Not sure I understand your plan. If all your indices have only one shard,  
how are you going to use routing with the aliases?

On Thursday, December 20, 2012 2:02:57 PM UTC-5, Wojons Tech wrote:

> A month ago I asked a question about sharding and routuing and so on. You  
> can find it here.  
> [Request: Add empty shard to existing Index · Issue #2443 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2443) I am  
> woundering if i create indexes with a single shard, and then add those  
> indexes to an alies and then i query and insert into the alies, and I use  
> routing, will my routing get messed up everytime i add a new index to the  
> route?

--

---

<div class="post-metadata">

**Author:** ![Alexis\_Okuwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexis_okuwa/32/1983_2.png) [@Alexis\_Okuwa](https://discuss.elastic.co/u/Alexis_Okuwa)\
**Post date:** [December 20, 2012, 10:43pm UTC](https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136/3 "2012-12-20T22:43:46Z")

</div>

Good point, I would start with 1 shard per day but as i get more traffic  
then 1 shard can handle i will then make another shard. and so on. These  
will have routes at some point i could have 20 shards I dont know where it  
will go but there will be routing what i am trying to undersand is if I use  
alies and route, does it route per index or does it route per alies index?

On Thursday, December 20, 2012 1:48:40 PM UTC-8, Igor Motov wrote:

> Not sure I understand your plan. If all your indices have only one shard,  
> how are you going to use routing with the aliases?
> 
> On Thursday, December 20, 2012 2:02:57 PM UTC-5, Wojons Tech wrote:
> 
> > A month ago I asked a question about sharding and routuing and so on. You  
> > can find it here.  
> > [Request: Add empty shard to existing Index · Issue #2443 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2443) I am  
> > woundering if i create indexes with a single shard, and then add those  
> > indexes to an alies and then i query and insert into the alies, and I use  
> > routing, will my routing get messed up everytime i add a new index to the  
> > route?

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [December 20, 2012, 11:07pm UTC](https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136/4 "2012-12-20T23:07:08Z")

</div>

When you are indexing using an alias, this alias has to resolve into a  
single index, so it doesn't matter.

On Thursday, December 20, 2012 5:43:46 PM UTC-5, Wojons Tech wrote:

> Good point, I would start with 1 shard per day but as i get more traffic  
> then 1 shard can handle i will then make another shard. and so on. These  
> will have routes at some point i could have 20 shards I dont know where it  
> will go but there will be routing what i am trying to undersand is if I use  
> alies and route, does it route per index or does it route per alies index?
> 
> On Thursday, December 20, 2012 1:48:40 PM UTC-8, Igor Motov wrote:
> 
> > Not sure I understand your plan. If all your indices have only one shard,  
> > how are you going to use routing with the aliases?
> > 
> > On Thursday, December 20, 2012 2:02:57 PM UTC-5, Wojons Tech wrote:
> > 
> > > A month ago I asked a question about sharding and routuing and so on.  
> > > You can find it here.  
> > > [Request: Add empty shard to existing Index · Issue #2443 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2443) I am  
> > > woundering if i create indexes with a single shard, and then add those  
> > > indexes to an alies and then i query and insert into the alies, and I use  
> > > routing, will my routing get messed up everytime i add a new index to the  
> > > route?

--

---

<div class="post-metadata">

**Author:** ![Alexis\_Okuwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexis_okuwa/32/1983_2.png) [@Alexis\_Okuwa](https://discuss.elastic.co/u/Alexis_Okuwa)\
**Post date:** [December 20, 2012, 11:15pm UTC](https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136/5 "2012-12-20T23:15:04Z")

</div>

Well when i am adding new values it will be to the index that is correct  
but most of my data is read only data, so when i am searching across an  
alies with multipal indeecs with different shard counts will my routes  
still work?

On Thursday, December 20, 2012 3:07:08 PM UTC-8, Igor Motov wrote:

> When you are indexing using an alias, this alias has to resolve into a  
> single index, so it doesn't matter.
> 
> On Thursday, December 20, 2012 5:43:46 PM UTC-5, Wojons Tech wrote:
> 
> > Good point, I would start with 1 shard per day but as i get more traffic  
> > then 1 shard can handle i will then make another shard. and so on. These  
> > will have routes at some point i could have 20 shards I dont know where it  
> > will go but there will be routing what i am trying to undersand is if I use  
> > alies and route, does it route per index or does it route per alies index?
> > 
> > On Thursday, December 20, 2012 1:48:40 PM UTC-8, Igor Motov wrote:
> > 
> > > Not sure I understand your plan. If all your indices have only one  
> > > shard, how are you going to use routing with the aliases?
> > > 
> > > On Thursday, December 20, 2012 2:02:57 PM UTC-5, Wojons Tech wrote:
> > > 
> > > > A month ago I asked a question about sharding and routuing and so on.  
> > > > You can find it here.  
> > > > [Request: Add empty shard to existing Index · Issue #2443 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2443) I am  
> > > > woundering if i create indexes with a single shard, and then add those  
> > > > indexes to an alies and then i query and insert into the alies, and I use  
> > > > routing, will my routing get messed up everytime i add a new index to the  
> > > > route?

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [December 20, 2012, 11:53pm UTC](https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136/6 "2012-12-20T23:53:59Z")

</div>

Yes, it should work. If you index a records with a certain routing value,  
you can expect this record to show up in the search results if search is  
using the same routing value even if you search against multiple indices.

Igor

On Thursday, December 20, 2012 6:15:04 PM UTC-5, Wojons Tech wrote:

> Well when i am adding new values it will be to the index that is correct  
> but most of my data is read only data, so when i am searching across an  
> alies with multipal indeecs with different shard counts will my routes  
> still work?
> 
> On Thursday, December 20, 2012 3:07:08 PM UTC-8, Igor Motov wrote:
> 
> > When you are indexing using an alias, this alias has to resolve into a  
> > single index, so it doesn't matter.
> > 
> > On Thursday, December 20, 2012 5:43:46 PM UTC-5, Wojons Tech wrote:
> > 
> > > Good point, I would start with 1 shard per day but as i get more traffic  
> > > then 1 shard can handle i will then make another shard. and so on. These  
> > > will have routes at some point i could have 20 shards I dont know where it  
> > > will go but there will be routing what i am trying to undersand is if I use  
> > > alies and route, does it route per index or does it route per alies index?
> > > 
> > > On Thursday, December 20, 2012 1:48:40 PM UTC-8, Igor Motov wrote:
> > > 
> > > > Not sure I understand your plan. If all your indices have only one  
> > > > shard, how are you going to use routing with the aliases?
> > > > 
> > > > On Thursday, December 20, 2012 2:02:57 PM UTC-5, Wojons Tech wrote:
> > > > 
> > > > > A month ago I asked a question about sharding and routuing and so on.  
> > > > > You can find it here.  
> > > > > [Request: Add empty shard to existing Index · Issue #2443 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2443) I am  
> > > > > woundering if i create indexes with a single shard, and then add those  
> > > > > indexes to an alies and then i query and insert into the alies, and I use  
> > > > > routing, will my routing get messed up everytime i add a new index to the  
> > > > > route?

--

---

<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:58am UTC](https://discuss.elastic.co/t/adding-indces-to-alies-and-routing/10136/7 "2017-07-06T02:58:55Z")

</div>


