# How to check what compression codec some of document use

**URL:** <https://discuss.elastic.co/t/how-to-check-what-compression-codec-some-of-document-use/282302>\
**Category:** Elasticsearch\
**Created:** [August 24, 2021, 6:32am UTC](https://discuss.elastic.co/t/how-to-check-what-compression-codec-some-of-document-use/282302 "2021-08-24T06:32:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![solarcore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/solarcore/32/93244_2.png) [@solarcore](https://discuss.elastic.co/u/solarcore)\
**Post date:** [August 24, 2021, 6:32am UTC](https://discuss.elastic.co/t/how-to-check-what-compression-codec-some-of-document-use/282302/1 "2021-08-24T06:32:10Z")

</div>

If i have some index, and i had default value of the codec in settings, then i change this setting to best\_compression, so my question is: How to check one document in an index, to know what codec this document use, default or the best\_compression, or maybe is there any way to get some statistics on how much of default documents in an index, and how much new with default\_compression?

---

<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:** [August 24, 2021, 8:35am UTC](https://discuss.elastic.co/t/how-to-check-what-compression-codec-some-of-document-use/282302/2 "2021-08-24T08:35:55Z")

</div>

Is this because you are changing compression levels?

---

<div class="post-metadata">

**Author:** ![solarcore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/solarcore/32/93244_2.png) [@solarcore](https://discuss.elastic.co/u/solarcore)\
**Post date:** [August 24, 2021, 8:57am UTC](https://discuss.elastic.co/t/how-to-check-what-compression-codec-some-of-document-use/282302/3 "2021-08-24T08:57:23Z")

</div>

Yes, i want to know what compression document use in index, about all index it's easy just looking at codec in settings, but on document, can i do that?

---

<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:** [August 24, 2021, 8:59am UTC](https://discuss.elastic.co/t/how-to-check-what-compression-codec-some-of-document-use/282302/4 "2021-08-24T08:59:49Z")

</div>

You can not. Once you have made the change new segments created through indexing or merging will use the new codec. If you are. I longer indexing into the index and want to reduce size I would recommend a forcemerge down to a single segment.

---

<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:** [September 21, 2021, 9:00am UTC](https://discuss.elastic.co/t/how-to-check-what-compression-codec-some-of-document-use/282302/5 "2021-09-21T09:00:20Z")

</div>

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