# How to split an existing index based on number of documents

**URL:** <https://discuss.elastic.co/t/how-to-split-an-existing-index-based-on-number-of-documents/309287>\
**Category:** Elasticsearch\
**Created:** [July 11, 2022, 5:12am UTC](https://discuss.elastic.co/t/how-to-split-an-existing-index-based-on-number-of-documents/309287 "2022-07-11T05:12:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aurovindo\_Sahu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aurovindo_sahu/32/100717_2.png) [@Aurovindo\_Sahu](https://discuss.elastic.co/u/Aurovindo_Sahu)\
**Post date:** [July 11, 2022, 5:12am UTC](https://discuss.elastic.co/t/how-to-split-an-existing-index-based-on-number-of-documents/309287/1 "2022-07-11T05:12:30Z")

</div>

We have an index of size 70GB which contains 73 million documents and we want to split this index based on number of documents.  
Is there any way we can divide the current index by taking number of documents into consideration?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 11, 2022, 5:14am UTC](https://discuss.elastic.co/t/how-to-split-an-existing-index-based-on-number-of-documents/309287/2 "2022-07-11T05:14:09Z")

</div>

Welcome to our community! 😃

Not easily I don't think, no. Why do you want to take this approach though?

---

<div class="post-metadata">

**Author:** ![Aurovindo\_Sahu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aurovindo_sahu/32/100717_2.png) [@Aurovindo\_Sahu](https://discuss.elastic.co/u/Aurovindo_Sahu)\
**Post date:** [July 11, 2022, 5:40am UTC](https://discuss.elastic.co/t/how-to-split-an-existing-index-based-on-number-of-documents/309287/3 "2022-07-11T05:40:11Z")

</div>

Because we want to separate year wise data into separate index.

---

<div class="post-metadata">

**Author:** ![Aurovindo\_Sahu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aurovindo_sahu/32/100717_2.png) [@Aurovindo\_Sahu](https://discuss.elastic.co/u/Aurovindo_Sahu)\
**Post date:** [July 11, 2022, 6:04am UTC](https://discuss.elastic.co/t/how-to-split-an-existing-index-based-on-number-of-documents/309287/4 "2022-07-11T06:04:18Z")

</div>

If splitting an index using document count is not possible then can we split it by taking size into consideration? Like for every 10 GB data into a separate index.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 11, 2022, 6:18am UTC](https://discuss.elastic.co/t/how-to-split-an-existing-index-based-on-number-of-documents/309287/5 "2022-07-11T06:18:51Z")

</div>

> [@Aurovindo\_Sahu](#):
>
> Because we want to separate year wise data into separate index.

Does that mean you have timestamps in your data? If so, that's easier to work with.

---

<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:** [August 8, 2022, 6:19am UTC](https://discuss.elastic.co/t/how-to-split-an-existing-index-based-on-number-of-documents/309287/6 "2022-08-08T06:19:16Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
