# Single index for multiple users with routing

**URL:** <https://discuss.elastic.co/t/single-index-for-multiple-users-with-routing/12764>\
**Category:** Elasticsearch\
**Created:** [July 12, 2013, 8:16am UTC](https://discuss.elastic.co/t/single-index-for-multiple-users-with-routing/12764 "2013-07-12T08:16:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthick\_Chokkalinga](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@Karthick\_Chokkalinga](https://discuss.elastic.co/u/Karthick_Chokkalinga)\
**Post date:** [July 12, 2013, 8:16am UTC](https://discuss.elastic.co/t/single-index-for-multiple-users-with-routing/12764/1 "2013-07-12T08:16:15Z")

</div>

I am planning to use single index for multiple users with routing

Based on the routing parameter, docs of a user will be stored in a shard.  
What will happen, if that shard's size reaches the max value? What is the  
solution?

Regards,  
Karthick

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 12, 2013, 8:30am UTC](https://discuss.elastic.co/t/single-index-for-multiple-users-with-routing/12764/2 "2013-07-12T08:30:59Z")

</div>

You can create for example an index with alias on top of it.  
When you hit the max value (for your use case), create a new index and use the same alias on top of it.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 12 juil. 2013 à 10:16, Karthick Chokkalingam [ckarthickc@gmail.com](mailto:ckarthickc@gmail.com) a écrit :

I am planning to use single index for multiple users with routing

Based on the routing parameter, docs of a user will be stored in a shard. What will happen, if that shard's size reaches the max value? What is the solution?

## Regards, Karthick

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Karthick\_Chokkalinga](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@Karthick\_Chokkalinga](https://discuss.elastic.co/u/Karthick_Chokkalinga)\
**Post date:** [July 12, 2013, 10:25am UTC](https://discuss.elastic.co/t/single-index-for-multiple-users-with-routing/12764/3 "2013-07-12T10:25:44Z")

</div>

Thank you.

So I have to create alias like below( in addition with common index alias  
user1 ) after hitting max value and use only  
[http://localhost:9200/user1(alias)/](http://localhost:9200/user1(alias)/) for index and search. Please correct me  
if I am wrong.

curl -XPOST '[http://localhost:9200/\_aliases](http://localhost:9200/_aliases)' -d '  
{  
"actions" : [  
{  
"add" : {  
"index" : "user-index-user1",  
"alias" : "user1",  
"filter" : { "term" : {"userid" : 1 } },  
"routing" : "1" }  
}  
]  
}'

On Friday, July 12, 2013 2:00:59 PM UTC+5:30, David Pilato wrote:

> You can create for example an index with alias on top of it.  
> When you hit the max value (for your use case), create a new index and use  
> the same alias on top of it.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 12 juil. 2013 à 10:16, Karthick Chokkalingam \<[ckart...@gmail.com](mailto:ckart...@gmail.com)\<javascript:\>\>  
> a écrit :
> 
> I am planning to use single index for multiple users with routing
> 
> Based on the routing parameter, docs of a user will be stored in a shard.  
> What will happen, if that shard's size reaches the max value? What is the  
> solution?
> 
> Regards,  
> Karthick
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:26am UTC](https://discuss.elastic.co/t/single-index-for-multiple-users-with-routing/12764/4 "2017-07-06T02:26:50Z")

</div>


