# How does the best\_compression work after I setting it?

**URL:** <https://discuss.elastic.co/t/how-does-the-best-compression-work-after-i-setting-it/78643>\
**Category:** Elasticsearch\
**Created:** [March 15, 2017, 5:42am UTC](https://discuss.elastic.co/t/how-does-the-best-compression-work-after-i-setting-it/78643 "2017-03-15T05:42:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![darouwan](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@darouwan](https://discuss.elastic.co/u/darouwan)\
**Post date:** [March 15, 2017, 5:42am UTC](https://discuss.elastic.co/t/how-does-the-best-compression-work-after-i-setting-it/78643/1 "2017-03-15T05:42:11Z")

</div>

I am working on index compression currently. Now I have existed index about 500MB to be compressed, but I meet the following questions:

1. When does the best\_compression work after I setting it? Immediately or after a while?
2. Does it work on existed index or the upcoming index data? Or both?
3. Have the index data been compressed by LZ4 if I don't set the index.codec ?

Thanks.

---

<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:** [March 19, 2017, 10:56pm UTC](https://discuss.elastic.co/t/how-does-the-best-compression-work-after-i-setting-it/78643/2 "2017-03-19T22:56:48Z")

</div>

By default we use LZ4.

To change this setting you need to close, update, reopen and then issue a force merge on the index in question for it to be applied. Otherwise if you move an index to a node that has that set in it's config, then issue a force merge, it'll be applied.

We should really make this clearer in the docs!

---

<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:** [March 19, 2017, 10:59pm UTC](https://discuss.elastic.co/t/how-does-the-best-compression-work-after-i-setting-it/78643/3 "2017-03-19T22:59:24Z")

</div>

[https://github.com/elastic/elasticsearch/issues/23646](https://github.com/elastic/elasticsearch/issues/23646) 🙂

---

<div class="post-metadata">

**Author:** ![darouwan](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@darouwan](https://discuss.elastic.co/u/darouwan)\
**Post date:** [March 20, 2017, 1:04am UTC](https://discuss.elastic.co/t/how-does-the-best-compression-work-after-i-setting-it/78643/4 "2017-03-20T01:04:08Z")

</div>

Thanks! Actually the issue in Github is submitted by me. LOL

---

<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:** [April 17, 2017, 1:04am UTC](https://discuss.elastic.co/t/how-does-the-best-compression-work-after-i-setting-it/78643/5 "2017-04-17T01:04:16Z")

</div>

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