# How can we set the size of an Index?

**URL:** <https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489>\
**Category:** Elasticsearch\
**Created:** [April 27, 2012, 10:59am UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489 "2012-04-27T10:59:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Jajoria](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Abhishek\_Jajoria](https://discuss.elastic.co/u/Abhishek_Jajoria)\
**Post date:** [April 27, 2012, 10:59am UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/1 "2012-04-27T10:59:51Z")

</div>

I have an index with 14miln docs and its current size is 2 gb which keeps  
on growing from couchdb river plugin . Is there any way so that I can set  
the size of an index so that if the size grows any further , ES should  
create a new index automatically

---

<div class="post-metadata">

**Author:** ![AEvar\_Arnfjord\_Bjarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aevar_arnfjord_bjarm/32/2746_2.png) [@AEvar\_Arnfjord\_Bjarm](https://discuss.elastic.co/u/AEvar_Arnfjord_Bjarm)\
**Post date:** [April 27, 2012, 11:19am UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/2 "2012-04-27T11:19:32Z")

</div>

On Fri, Apr 27, 2012 at 12:59, jajoria abhishek  
[jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) wrote:

> I have an index with 14miln docs and its current size is 2 gb which keeps on  
> growing from couchdb river plugin . Is there any way so that I can set the  
> size of an index so that if the size grows any further , ES should create a  
> new index automatically

No, just write a script external to ES that polls it for the size and  
creates a new index if it exceeds the size limit.

---

<div class="post-metadata">

**Author:** ![Abhishek\_Jajoria](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Abhishek\_Jajoria](https://discuss.elastic.co/u/Abhishek_Jajoria)\
**Post date:** [April 27, 2012, 11:33am UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/3 "2012-04-27T11:33:09Z")

</div>

How can we check the size of index using script ?

On Fri, Apr 27, 2012 at 4:49 PM, Ævar Arnfjörð Bjarmason  
[avarab@gmail.com](mailto:avarab@gmail.com)wrote:

> On Fri, Apr 27, 2012 at 12:59, jajoria abhishek  
> [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) wrote:
> 
> > I have an index with 14miln docs and its current size is 2 gb which  
> > keeps on  
> > growing from couchdb river plugin . Is there any way so that I can set  
> > the  
> > size of an index so that if the size grows any further , ES should  
> > create a  
> > new index automatically
> 
> No, just write a script external to ES that polls it for the size and  
> creates a new index if it exceeds the size limit.

---

<div class="post-metadata">

**Author:** ![AEvar\_Arnfjord\_Bjarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aevar_arnfjord_bjarm/32/2746_2.png) [@AEvar\_Arnfjord\_Bjarm](https://discuss.elastic.co/u/AEvar_Arnfjord_Bjarm)\
**Post date:** [April 27, 2012, 12:03pm UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/4 "2012-04-27T12:03:21Z")

</div>

On Fri, Apr 27, 2012 at 13:33, jajoria abhishek  
[jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) wrote:

> How can we check the size of index using script ?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

---

<div class="post-metadata">

**Author:** ![Abhishek\_Jajoria](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Abhishek\_Jajoria](https://discuss.elastic.co/u/Abhishek_Jajoria)\
**Post date:** [April 27, 2012, 12:09pm UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/5 "2012-04-27T12:09:12Z")

</div>

thanks

On Fri, Apr 27, 2012 at 5:33 PM, Ævar Arnfjörð Bjarmason  
[avarab@gmail.com](mailto:avarab@gmail.com)wrote:

> On Fri, Apr 27, 2012 at 13:33, jajoria abhishek  
> [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) wrote:
> 
> > How can we check the size of index using script ?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-status.html)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 29, 2012, 4:38pm UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/6 "2012-04-29T16:38:11Z")

</div>

Indices stats is preferred compared to indices status API (with store and  
possibly docs flags set).

On Fri, Apr 27, 2012 at 3:09 PM, jajoria abhishek \<  
[jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)\> wrote:

> thanks
> 
> On Fri, Apr 27, 2012 at 5:33 PM, Ævar Arnfjörð Bjarmason \<[avarab@gmail.com](mailto:avarab@gmail.com)
> 
> > wrote:
> 
> > On Fri, Apr 27, 2012 at 13:33, jajoria abhishek  
> > [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) wrote:
> > 
> > > How can we check the size of index using script ?
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-status.html)

---

<div class="post-metadata">

**Author:** ![Abhishek\_Jajoria](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Abhishek\_Jajoria](https://discuss.elastic.co/u/Abhishek_Jajoria)\
**Post date:** [April 30, 2012, 4:38am UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/7 "2012-04-30T04:38:28Z")

</div>

How can we check Indices stats using java API?

On Sun, Apr 29, 2012 at 10:08 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Indices stats is preferred compared to indices status API (with store and  
> possibly docs flags set).
> 
> On Fri, Apr 27, 2012 at 3:09 PM, jajoria abhishek \<  
> [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)\> wrote:
> 
> > thanks
> > 
> > On Fri, Apr 27, 2012 at 5:33 PM, Ævar Arnfjörð Bjarmason \<  
> > [avarab@gmail.com](mailto:avarab@gmail.com)\> wrote:
> > 
> > > On Fri, Apr 27, 2012 at 13:33, jajoria abhishek  
> > > [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) wrote:
> > > 
> > > > How can we check the size of index using script ?
> > > 
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-status.html)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 1, 2012, 2:52pm UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/8 "2012-05-01T14:52:31Z")

</div>

client.admin().indices().prepareStats...

On Mon, Apr 30, 2012 at 7:38 AM, jajoria abhishek \<  
[jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)\> wrote:

> How can we check Indices stats using java API?
> 
> On Sun, Apr 29, 2012 at 10:08 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Indices stats is preferred compared to indices status API (with store and  
> > possibly docs flags set).
> > 
> > On Fri, Apr 27, 2012 at 3:09 PM, jajoria abhishek \<  
> > [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com)\> wrote:
> > 
> > > thanks
> > > 
> > > On Fri, Apr 27, 2012 at 5:33 PM, Ævar Arnfjörð Bjarmason \<  
> > > [avarab@gmail.com](mailto:avarab@gmail.com)\> wrote:
> > > 
> > > > On Fri, Apr 27, 2012 at 13:33, jajoria abhishek  
> > > > [jajoria.abhishek@gmail.com](mailto:jajoria.abhishek@gmail.com) wrote:
> > > > 
> > > > > How can we check the size of index using script ?
> > > > 
> > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-status.html)

---

<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, 3:30am UTC](https://discuss.elastic.co/t/how-can-we-set-the-size-of-an-index/7489/9 "2017-07-06T03:30:27Z")

</div>


