# Disable index compression

**URL:** https://discuss.elastic.co/t/disable-index-compression/360981
**Category:** Elastic Search
**Created:** [June 6, 2024, 3:37pm UTC](https://discuss.elastic.co/t/disable-index-compression/360981 "2024-06-06T15:37:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![tommyd](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tommyd](https://discuss.elastic.co/u/tommyd)
#### Post date: [June 6, 2024, 3:37pm UTC](https://discuss.elastic.co/t/disable-index-compression/360981/1 "2024-06-06T15:37:45Z")

</div>

Hi Elasticsearch gurus,

I asked this question before about disabling compression on Elasticsearch index and Stephen Brown and David Turner were kind enough to reply that it's not possible. But if it is, then it needs to be recompiled and repackaged. I guess the questions I have are:

1. If it's not possible, then I am okay with that.
2. But if it is possible, can you share how to do it? Or is it because it needs to be recompiled and only Elasticsearch can perform such actions?  
The previous question was posted here for some context.  
[Disabling Elasticsearch Index compression version 7.10+](https://discuss.elastic.co/t/disabling-elasticsearch-index-compression-version-7-10/357648)

Best,

Tom

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [June 6, 2024, 3:59pm UTC](https://discuss.elastic.co/t/disable-index-compression/360981/2 "2024-06-06T15:59:17Z")

</div>

I think that the last answer by David answers both of your questions:

> For completeness, yes, you would need to compile and repackage Elasticsearch (and quite possibly some of its dependencies) to disable compression.  
> I wouldn't be surprised to see worse performance after doing so too - the OS page cache would be working with the uncompressed data and so will fill up much much faster, and this is an extremely important factor for performance. There's a good reason this isn't offered as an option.

Out of the box there is no way to disable compression, you can only choose between LZ4 and DEFLATE.

It may be possible if you change the code, but I don't think you will find anything telling you how to do this, you will probably dig into the code of both Elasticsearch and some dependecies like Lucene to understand how it works and see what you need to do to disable compression.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [June 6, 2024, 4:26pm UTC](https://discuss.elastic.co/t/disable-index-compression/360981/3 "2024-06-06T16:26:15Z")

</div>

For example, on Github you have instructions on how to build it from source.

> **[GitHub - elastic/elasticsearch: Free and Open, Distributed, RESTful Search...](https://github.com/elastic/elasticsearch?tab=readme-ov-file#build-from-source)**
>
> Free and Open, Distributed, RESTful Search Engine. Contribute to elastic/elasticsearch development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![tommyd](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tommyd](https://discuss.elastic.co/u/tommyd)
#### Post date: [June 6, 2024, 5:01pm UTC](https://discuss.elastic.co/t/disable-index-compression/360981/4 "2024-06-06T17:01:05Z")

</div>

Thanks, Leandro! Very helpful!

Tom

---

<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 4, 2024, 5:01pm UTC](https://discuss.elastic.co/t/disable-index-compression/360981/5 "2024-07-04T17:01:51Z")

</div>

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