# Index with same mapping has different size

**URL:** <https://discuss.elastic.co/t/index-with-same-mapping-has-different-size/132498>\
**Category:** Elasticsearch\
**Created:** [May 18, 2018, 1:59pm UTC](https://discuss.elastic.co/t/index-with-same-mapping-has-different-size/132498 "2018-05-18T13:59:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![randomuser](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@randomuser](https://discuss.elastic.co/u/randomuser)\
**Post date:** [May 18, 2018, 1:59pm UTC](https://discuss.elastic.co/t/index-with-same-mapping-has-different-size/132498/1 "2018-05-18T13:59:44Z")

</div>

Hello,

I'm testing something and reindexing indices using the same mapping, but every time I reindex, the size of the newly created index always differs, shouldn't it be a constant number?

---

<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:** [May 20, 2018, 9:05am UTC](https://discuss.elastic.co/t/index-with-same-mapping-has-different-size/132498/2 "2018-05-20T09:05:27Z")

</div>

Depends, are you doing a force merge on the indices after indexing?  
Do they have the same number of shards? Are you specifying a custom `_id`?

---

<div class="post-metadata">

**Author:** ![randomuser](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@randomuser](https://discuss.elastic.co/u/randomuser)\
**Post date:** [May 21, 2018, 6:44am UTC](https://discuss.elastic.co/t/index-with-same-mapping-has-different-size/132498/3 "2018-05-21T06:44:12Z")

</div>

Nope, not doing a force merge after indexing  
Yeah they have the same number of shards, everything's the same  
hmm I'm not specifying a custom \_id

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 21, 2018, 7:22am UTC](https://discuss.elastic.co/t/index-with-same-mapping-has-different-size/132498/4 "2018-05-21T07:22:21Z")

</div>

Elasticsearch performs merges during indices, which can make used disk space vary quite a lot depending on where in the cycle you are. Whenever comparing storage, e.g. using different mappings like in [this blog post](https://www.elastic.co/blog/filebeat-modiles-access-logs-and-elasticsearch-storage-requirements), it is recommended to always run force merge down to a single segment in order to ensure a fair comparison.

---

<div class="post-metadata">

**Author:** ![randomuser](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@randomuser](https://discuss.elastic.co/u/randomuser)\
**Post date:** [May 21, 2018, 1:20pm UTC](https://discuss.elastic.co/t/index-with-same-mapping-has-different-size/132498/5 "2018-05-21T13:20:25Z")

</div>

thank you!!

---

<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:** [June 18, 2018, 1:20pm UTC](https://discuss.elastic.co/t/index-with-same-mapping-has-different-size/132498/6 "2018-06-18T13:20:32Z")

</div>

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