# I have a few million users, and I want to index for per user, but

**URL:** <https://discuss.elastic.co/t/i-have-a-few-million-users-and-i-want-to-index-for-per-user-but/20627>\
**Category:** Elasticsearch\
**Created:** [November 7, 2014, 8:09am UTC](https://discuss.elastic.co/t/i-have-a-few-million-users-and-i-want-to-index-for-per-user-but/20627 "2014-11-07T08:09:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_shi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_shi/32/1125_2.png) [@David\_shi](https://discuss.elastic.co/u/David_shi)\
**Post date:** [November 7, 2014, 8:09am UTC](https://discuss.elastic.co/t/i-have-a-few-million-users-and-i-want-to-index-for-per-user-but/20627/1 "2014-11-07T08:09:03Z")

</div>

I have a few million users, and will continue to grow, maybe a year later  
increased to 1000W.

each user have a lot of files , the file size is not fixed, maybe more from  
1M ~ 10M.

I need to do is to give each user's document indexing, and allow the  
current user can quickly search through the right content to the document.

I have to think of is to build an index for each user, but there are  
restrictions on the number of files in Linux single directory.

You have any good suggestions for me???

Thank you very much!!!!!

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d5123953-b3b8-4dbb-9c1a-566515d51172%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d5123953-b3b8-4dbb-9c1a-566515d51172%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [November 7, 2014, 12:22pm UTC](https://discuss.elastic.co/t/i-have-a-few-million-users-and-i-want-to-index-for-per-user-but/20627/3 "2014-11-07T12:22:05Z")

</div>

Just add the user's id or name to each document and add a term filter to  
all of their queries. Then use routing  
[http://www.elasticsearch.org/blog/customizing-your-document-routing/](http://www.elasticsearch.org/blog/customizing-your-document-routing/). At  
least that is the canonical way to solve it.

On Fri, Nov 7, 2014 at 3:09 AM, David shi [fackweb@gmail.com](mailto:fackweb@gmail.com) wrote:

> I have a few million users, and will continue to grow, maybe a year later  
> increased to 1000W.
> 
> each user have a lot of files , the file size is not fixed, maybe more  
> from 1M ~ 10M.
> 
> I need to do is to give each user's document indexing, and allow the  
> current user can quickly search through the right content to the document.
> 
> I have to think of is to build an index for each user, but there are  
> restrictions on the number of files in Linux single directory.
> 
> You have any good suggestions for me???
> 
> Thank you very much!!!!!
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d5123953-b3b8-4dbb-9c1a-566515d51172%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d5123953-b3b8-4dbb-9c1a-566515d51172%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/d5123953-b3b8-4dbb-9c1a-566515d51172%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d5123953-b3b8-4dbb-9c1a-566515d51172%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1J0FnyxDr%3D3iFh52kt3boAcWrcZ4FTwPhs6yuuS8RgBg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1J0FnyxDr%3D3iFh52kt3boAcWrcZ4FTwPhs6yuuS8RgBg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:51am UTC](https://discuss.elastic.co/t/i-have-a-few-million-users-and-i-want-to-index-for-per-user-but/20627/4 "2017-07-06T00:51:30Z")

</div>


