# Am I compressing?

**URL:** <https://discuss.elastic.co/t/am-i-compressing/9336>\
**Category:** Elasticsearch\
**Created:** [October 12, 2012, 12:39pm UTC](https://discuss.elastic.co/t/am-i-compressing/9336 "2012-10-12T12:39:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed\_Lrhazi](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@Mohamed\_Lrhazi](https://discuss.elastic.co/u/Mohamed_Lrhazi)\
**Post date:** [October 12, 2012, 12:39pm UTC](https://discuss.elastic.co/t/am-i-compressing/9336/1 "2012-10-12T12:39:16Z")

</div>

in Search head, my cluster status shows:  
{  
state: open  
settings: {  
index.compress: true  
index.number\_of\_replicas: 1  
index.number\_of\_shards: 12  
index.refresh\_interval: 10s  
index.version.created: 190999  
}

The index was created like so:  
conn.create\_index\_if\_missing(index\_name,settings={'compress':  
'true',"number\_of\_shards" : 12,"number\_of\_replicas" : 1,"refresh\_interval"  
: "10s",})

Is it the case that all stored fields are now compressed? or do I need to  
specify compression option at the fields/mapping level as well?

Thanks a lot,  
Mohamed.

--

---

<div class="post-metadata">

**Author:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [October 12, 2012, 3:43pm UTC](https://discuss.elastic.co/t/am-i-compressing/9336/2 "2012-10-12T15:43:52Z")

</div>

hey,

see [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/store.html)  
(Store Level Compression)

you should use index.store.compress.stored

for this or you if you only want to compress the \_source field you need to  
enable that in the mapping. Yet, store level compression has better  
compression compared to \_source.

simon  
On Friday, October 12, 2012 2:39:16 PM UTC+2, Mohamed Lrhazi wrote:

> in Search head, my cluster status shows:  
> {  
> state: open  
> settings: {  
> index.compress: true  
> index.number\_of\_replicas: 1  
> index.number\_of\_shards: 12  
> index.refresh\_interval: 10s  
> index.version.created: 190999  
> }
> 
> The index was created like so:  
> conn.create\_index\_if\_missing(index\_name,settings={'compress':  
> 'true',"number\_of\_shards" : 12,"number\_of\_replicas" : 1,"refresh\_interval"  
> : "10s",})
> 
> Is it the case that all stored fields are now compressed? or do I need to  
> specify compression option at the fields/mapping level as well?
> 
> Thanks a lot,  
> Mohamed.

--

---

<div class="post-metadata">

**Author:** ![Mohamed\_Lrhazi](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@Mohamed\_Lrhazi](https://discuss.elastic.co/u/Mohamed_Lrhazi)\
**Post date:** [October 12, 2012, 5:27pm UTC](https://discuss.elastic.co/t/am-i-compressing/9336/3 "2012-10-12T17:27:18Z")

</div>

Cool thanks a lot. do I still need the first level "compress" field in my  
index creation settings, or is that redundant now?

settings={  
'compress': 'true',  
"number\_of\_shards" : 12,  
"number\_of\_replicas" : 1,  
"refresh\_interval" : "10s",  
"store": {"compress": {"stored": 'true',"tv": 'true'},},  
}

On Friday, October 12, 2012 11:43:52 AM UTC-4, simonw wrote:

> hey,
> 
> see [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/store.html)(Store Level Compression)
> 
> you should use index.store.compress.stored
> 
> for this or you if you only want to compress the \_source field you need to  
> enable that in the mapping. Yet, store level compression has better  
> compression compared to \_source.
> 
> simon  
> On Friday, October 12, 2012 2:39:16 PM UTC+2, Mohamed Lrhazi wrote:
> 
> > in Search head, my cluster status shows:  
> > {  
> > state: open  
> > settings: {  
> > index.compress: true  
> > index.number\_of\_replicas: 1  
> > index.number\_of\_shards: 12  
> > index.refresh\_interval: 10s  
> > index.version.created: 190999  
> > }
> > 
> > The index was created like so:  
> > conn.create\_index\_if\_missing(index\_name,settings={'compress':  
> > 'true',"number\_of\_shards" : 12,"number\_of\_replicas" : 1,"refresh\_interval"  
> > : "10s",})
> > 
> > Is it the case that all stored fields are now compressed? or do I need to  
> > specify compression option at the fields/mapping level as well?
> > 
> > Thanks a lot,  
> > Mohamed.

--

---

<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 6, 2017, 3:09am UTC](https://discuss.elastic.co/t/am-i-compressing/9336/4 "2017-07-06T03:09:03Z")

</div>


