# 1 large index vs several smaller indexes

**URL:** <https://discuss.elastic.co/t/1-large-index-vs-several-smaller-indexes/16872>\
**Category:** Elasticsearch\
**Created:** [April 8, 2014, 9:58am UTC](https://discuss.elastic.co/t/1-large-index-vs-several-smaller-indexes/16872 "2014-04-08T09:58:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcio\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Marcio\_Rodrigues](https://discuss.elastic.co/u/Marcio_Rodrigues)\
**Post date:** [April 8, 2014, 9:58am UTC](https://discuss.elastic.co/t/1-large-index-vs-several-smaller-indexes/16872/1 "2014-04-08T09:58:17Z")

</div>

Still new to ES, so I was wondering what would be the best approach.

Say you have for example a company with different branhes throughout the  
country and their documents will be stored centrally, but need to be  
searched sepperately.

Would it be better to create one index for all documents and use filters on  
the queries or better to make a sepperate index for each branch?

By better I mean most efficient in terms of performance a resource usage.

--  
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/bf5107ce-4803-4fa1-89fe-a20cf678bb00%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf5107ce-4803-4fa1-89fe-a20cf678bb00%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [April 8, 2014, 10:02am UTC](https://discuss.elastic.co/t/1-large-index-vs-several-smaller-indexes/16872/2 "2014-04-08T10:02:05Z")

</div>

Geo-locating can help with performance (having the UK branch use a UK  
datacenter and a US branch a NA datacenter) and this most easily achieved  
by separating clusters. You can use a Tribe node to work on multiple  
clusters if it ever comes to it/

Other than that your question really depends on the amounts of data and  
types of queries you make. It does sound like the docs are completely  
unrelated so different indexes (and even clusters) does make sense.

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Tue, Apr 8, 2014 at 12:58 PM, Marcio Rodrigues [marshy1001@gmail.com](mailto:marshy1001@gmail.com)wrote:

> Still new to ES, so I was wondering what would be the best approach.
> 
> Say you have for example a company with different branhes throughout the  
> country and their documents will be stored centrally, but need to be  
> searched sepperately.
> 
> Would it be better to create one index for all documents and use filters  
> on the queries or better to make a sepperate index for each branch?
> 
> By better I mean most efficient in terms of performance a resource usage.
> 
> --  
> 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/bf5107ce-4803-4fa1-89fe-a20cf678bb00%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf5107ce-4803-4fa1-89fe-a20cf678bb00%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bf5107ce-4803-4fa1-89fe-a20cf678bb00%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bf5107ce-4803-4fa1-89fe-a20cf678bb00%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/CAHTr4ZvZ4ejSgRPdQz4vN5GZ6jzviu60Ke6Z7%2B7fcfw5mPXkcQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvZ4ejSgRPdQz4vN5GZ6jzviu60Ke6Z7%2B7fcfw5mPXkcQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Marcio\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Marcio\_Rodrigues](https://discuss.elastic.co/u/Marcio_Rodrigues)\
**Post date:** [April 11, 2014, 3:20pm UTC](https://discuss.elastic.co/t/1-large-index-vs-several-smaller-indexes/16872/3 "2014-04-11T15:20:42Z")

</div>

Sorry, just saw your Reply now.

Thnaks, I will go with multiple indexes.

On Tuesday, April 8, 2014 11:02:05 AM UTC+1, Itamar Syn-Hershko wrote:

> Geo-locating can help with performance (having the UK branch use a UK  
> datacenter and a US branch a NA datacenter) and this most easily achieved  
> by separating clusters. You can use a Tribe node to work on multiple  
> clusters if it ever comes to it/
> 
> Other than that your question really depends on the amounts of data and  
> types of queries you make. It does sound like the docs are completely  
> unrelated so different indexes (and even clusters) does make sense.
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)
> 
> On Tue, Apr 8, 2014 at 12:58 PM, Marcio Rodrigues \<[marsh...@gmail.com](mailto:marsh...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Still new to ES, so I was wondering what would be the best approach.
> > 
> > Say you have for example a company with different branhes throughout the  
> > country and their documents will be stored centrally, but need to be  
> > searched sepperately.
> > 
> > Would it be better to create one index for all documents and use filters  
> > on the queries or better to make a sepperate index for each branch?
> > 
> > By better I mean most efficient in terms of performance a resource usage.
> > 
> > --  
> > 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:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/bf5107ce-4803-4fa1-89fe-a20cf678bb00%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf5107ce-4803-4fa1-89fe-a20cf678bb00%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bf5107ce-4803-4fa1-89fe-a20cf678bb00%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bf5107ce-4803-4fa1-89fe-a20cf678bb00%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/910af15d-8385-4024-984c-ea77f505c705%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/910af15d-8385-4024-984c-ea77f505c705%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jilles\_van\_Gurp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jilles_van_gurp/32/879_2.png) [@Jilles\_van\_Gurp](https://discuss.elastic.co/u/Jilles_van_Gurp)\
**Post date:** [April 16, 2014, 12:30pm UTC](https://discuss.elastic.co/t/1-large-index-vs-several-smaller-indexes/16872/4 "2014-04-16T12:30:12Z")

</div>

I would separate the performance issue from the logical structure of your  
domain. You really need to thing in terms of numbers of documents and  
shards (and not indices).

You may want to look into using index aliases, which can take a filter.  
That way you can have one index and several branch aliases with a filter.  
Or alternatively you can have one index per branch and then a company alias  
that includes all branch indexes. That way you can do company wide  
searches. It all depends on what you need.

Jilles

On Tuesday, April 8, 2014 11:58:17 AM UTC+2, Marcio Rodrigues wrote:

> Still new to ES, so I was wondering what would be the best approach.
> 
> Say you have for example a company with different branhes throughout the  
> country and their documents will be stored centrally, but need to be  
> searched sepperately.
> 
> Would it be better to create one index for all documents and use filters  
> on the queries or better to make a sepperate index for each branch?
> 
> By better I mean most efficient in terms of performance a resource usage.

--  
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/4c77e453-20c2-40aa-88da-20086cd096fa%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4c77e453-20c2-40aa-88da-20086cd096fa%40googlegroups.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, 1:35am UTC](https://discuss.elastic.co/t/1-large-index-vs-several-smaller-indexes/16872/5 "2017-07-06T01:35:31Z")

</div>


