# Newbie question: Do I need multiple indexes for this use case? Why?

**URL:** <https://discuss.elastic.co/t/newbie-question-do-i-need-multiple-indexes-for-this-use-case-why/11536>\
**Category:** Elasticsearch\
**Created:** [April 10, 2013, 4:10pm UTC](https://discuss.elastic.co/t/newbie-question-do-i-need-multiple-indexes-for-this-use-case-why/11536 "2013-04-10T16:10:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Heller](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@Jacob\_Heller](https://discuss.elastic.co/u/Jacob_Heller)\
**Post date:** [April 10, 2013, 4:10pm UTC](https://discuss.elastic.co/t/newbie-question-do-i-need-multiple-indexes-for-this-use-case-why/11536/1 "2013-04-10T16:10:20Z")

</div>

Hi all,

Just starting out with ES, and I have a question about the purpose of  
indexes.

In my use case, I will be searching millions of U.S. court cases. These  
cases come from multiple courts--i.e., the U.S. Supreme Court, the First  
Circuit Court of Appeals, Second Circuit... Iowa State Supreme Court...  
etc. Each case will have the same fields, so mapping for each document will  
not differ.

Sometimes my users will want to search across all courts. Other times,  
they'll want to just search specific courts -- for example, only courts in  
California, or only the Supreme Court.

I was originally thinking of having just one index, and making the court a  
(faceted?) field. But I'm wondering if this is an appropriate use of  
multiple indexes? If so, what do I gain by having more than one index? Is  
it performance-related, or will it somehow be better for me as the  
developer?

Thanks,  
Jake

--  
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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [April 10, 2013, 9:15pm UTC](https://discuss.elastic.co/t/newbie-question-do-i-need-multiple-indexes-for-this-use-case-why/11536/2 "2013-04-10T21:15:58Z")

</div>

With multiple indices, you can set different sharding and replication  
values for each individual index if the size varies greatly. I doubt your  
volume of data differs several orders of magnitude between each court.  
Another benefit is the ability to close a particular index if it is no  
longer needed. Once again, not your use case.

I would use one index, IMHO.

Cheers,

Ivan

On Wed, Apr 10, 2013 at 9:10 AM, Jacob Heller [jacob.heller@gmail.com](mailto:jacob.heller@gmail.com)wrote:

> Hi all,
> 
> Just starting out with ES, and I have a question about the purpose of  
> indexes.
> 
> In my use case, I will be searching millions of U.S. court cases. These  
> cases come from multiple courts--i.e., the U.S. Supreme Court, the First  
> Circuit Court of Appeals, Second Circuit... Iowa State Supreme Court...  
> etc. Each case will have the same fields, so mapping for each document will  
> not differ.
> 
> Sometimes my users will want to search across all courts. Other times,  
> they'll want to just search specific courts -- for example, only courts in  
> California, or only the Supreme Court.
> 
> I was originally thinking of having just one index, and making the court a  
> (faceted?) field. But I'm wondering if this is an appropriate use of  
> multiple indexes? If so, what do I gain by having more than one index? Is  
> it performance-related, or will it somehow be better for me as the  
> developer?
> 
> Thanks,  
> Jake
> 
> --  
> 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:** ![Jacob\_Heller](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@Jacob\_Heller](https://discuss.elastic.co/u/Jacob_Heller)\
**Post date:** [April 11, 2013, 2:48pm UTC](https://discuss.elastic.co/t/newbie-question-do-i-need-multiple-indexes-for-this-use-case-why/11536/3 "2013-04-11T14:48:23Z")

</div>

Thanks very much, Ivan! I'll proceed with one index then.

On Wed, Apr 10, 2013 at 5:15 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> With multiple indices, you can set different sharding and replication  
> values for each individual index if the size varies greatly. I doubt your  
> volume of data differs several orders of magnitude between each court.  
> Another benefit is the ability to close a particular index if it is no  
> longer needed. Once again, not your use case.
> 
> I would use one index, IMHO.
> 
> Cheers,
> 
> Ivan
> 
> On Wed, Apr 10, 2013 at 9:10 AM, Jacob Heller [jacob.heller@gmail.com](mailto:jacob.heller@gmail.com)wrote:
> 
> > Hi all,
> > 
> > Just starting out with ES, and I have a question about the purpose of  
> > indexes.
> > 
> > In my use case, I will be searching millions of U.S. court cases. These  
> > cases come from multiple courts--i.e., the U.S. Supreme Court, the First  
> > Circuit Court of Appeals, Second Circuit... Iowa State Supreme Court...  
> > etc. Each case will have the same fields, so mapping for each document will  
> > not differ.
> > 
> > Sometimes my users will want to search across all courts. Other times,  
> > they'll want to just search specific courts -- for example, only courts in  
> > California, or only the Supreme Court.
> > 
> > I was originally thinking of having just one index, and making the court  
> > a (faceted?) field. But I'm wondering if this is an appropriate use of  
> > multiple indexes? If so, what do I gain by having more than one index? Is  
> > it performance-related, or will it somehow be better for me as the  
> > developer?
> > 
> > Thanks,  
> > Jake
> > 
> > --  
> > 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 a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/nyoqab\_PZss/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/nyoqab_PZss/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, 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:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [April 11, 2013, 7:08pm UTC](https://discuss.elastic.co/t/newbie-question-do-i-need-multiple-indexes-for-this-use-case-why/11536/4 "2013-04-11T19:08:24Z")

</div>

Also something to keep in mind, if a particular court ever _does_ grow an  
order of magnitude, you can use aliases to transparently route those courts  
to their own index, allowing you to fine-tune their shard allocation.

-Zach

On Thursday, April 11, 2013 10:48:23 AM UTC-4, Jacob Heller wrote:

> Thanks very much, Ivan! I'll proceed with one index then.
> 
> On Wed, Apr 10, 2013 at 5:15 PM, Ivan Brusic \<[iv...@brusic.com](mailto:iv...@brusic.com)\<javascript:\>
> 
> > wrote:
> 
> > With multiple indices, you can set different sharding and replication  
> > values for each individual index if the size varies greatly. I doubt your  
> > volume of data differs several orders of magnitude between each court.  
> > Another benefit is the ability to close a particular index if it is no  
> > longer needed. Once again, not your use case.
> > 
> > I would use one index, IMHO.
> > 
> > Cheers,
> > 
> > Ivan
> > 
> > On Wed, Apr 10, 2013 at 9:10 AM, Jacob Heller \<[jacob....@gmail.com](mailto:jacob....@gmail.com)\<javascript:\>
> > 
> > > wrote:
> > 
> > > Hi all,
> > > 
> > > Just starting out with ES, and I have a question about the purpose of  
> > > indexes.
> > > 
> > > In my use case, I will be searching millions of U.S. court cases. These  
> > > cases come from multiple courts--i.e., the U.S. Supreme Court, the First  
> > > Circuit Court of Appeals, Second Circuit... Iowa State Supreme Court...  
> > > etc. Each case will have the same fields, so mapping for each document will  
> > > not differ.
> > > 
> > > Sometimes my users will want to search across all courts. Other times,  
> > > they'll want to just search specific courts -- for example, only courts in  
> > > California, or only the Supreme Court.
> > > 
> > > I was originally thinking of having just one index, and making the court  
> > > a (faceted?) field. But I'm wondering if this is an appropriate use of  
> > > multiple indexes? If so, what do I gain by having more than one index? Is  
> > > it performance-related, or will it somehow be better for me as the  
> > > developer?
> > > 
> > > Thanks,  
> > > Jake
> > > 
> > > --  
> > > 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 a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/nyoqab\_PZss/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/nyoqab_PZss/unsubscribe?hl=en-US)  
> > .  
> > To unsubscribe from this group and all its topics, 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:41am UTC](https://discuss.elastic.co/t/newbie-question-do-i-need-multiple-indexes-for-this-use-case-why/11536/5 "2017-07-06T02:41:30Z")

</div>


