# Disable \_source field

**URL:** <https://discuss.elastic.co/t/disable-source-field/335434>\
**Category:** Elasticsearch\
**Created:** [June 7, 2023, 11:39am UTC](https://discuss.elastic.co/t/disable-source-field/335434 "2023-06-07T11:39:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mhag](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhag/32/118090_2.png) [@Mhag](https://discuss.elastic.co/u/Mhag)\
**Post date:** [June 7, 2023, 11:39am UTC](https://discuss.elastic.co/t/disable-source-field/335434/1 "2023-06-07T11:39:36Z")

</div>

Hello,

I'm currently working on optimizing the size of an index. After reviewing the documentation and analyzing the field sizes, I found that a significant portion of the document size is attributed to the `_source` field. In an attempt to reduce the size of this index, I disabled the `_source` field. However, I noticed that after disabling it, none of the other fields except for `_idx` and some default fields are visible in Kibana.

Now I'm wondering if it's possible to disable the `_source` field without losing the visibility of all the other fields. Or perhaps I have misunderstood the purpose of the `_source` field in the context of reducing the index size.

Thank you, Best regards

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [June 7, 2023, 1:36pm UTC](https://discuss.elastic.co/t/disable-source-field/335434/2 "2023-06-07T13:36:54Z")

</div>

Hi @Mhag,

Disabling the \_source field is not recommended and there is a [warning in the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html#disable-source-field) of the impact it can have.

Which version of Elasticsearch are you using? Depending on the version you are using, you could consider using [`synthetic_source`](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html#synthetic-source) which means the source field is regenerated. Just a warning that as of 8.8 it is still in technical preview for non-TSDB indices.

---

<div class="post-metadata">

**Author:** ![Mhag](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhag/32/118090_2.png) [@Mhag](https://discuss.elastic.co/u/Mhag)\
**Post date:** [June 7, 2023, 2:40pm UTC](https://discuss.elastic.co/t/disable-source-field/335434/3 "2023-06-07T14:40:29Z")

</div>

Hi @carly.richmond ,

Thanks for your response, I use version 8.6.

the synthetic trick didn't help, the size of my test index was 1.38 mb with 308 events if I enable synthetic \_source the size is more ?!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/3/434f785769545be9ca5cc52b23acfab277a84bd8.png)

Regrads

---

<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:** [June 7, 2023, 10:55pm UTC](https://discuss.elastic.co/t/disable-source-field/335434/4 "2023-06-07T22:55:23Z")

</div>

I'm not sure you will see a noticeable difference when you are talking about megs/hundreds of documents, and you'd be better off testing gigs/millions of documents.

---

<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:** [June 8, 2023, 5:39am UTC](https://discuss.elastic.co/t/disable-source-field/335434/5 "2023-06-08T05:39:53Z")

</div>

Whenever you are comparing storage size on disk I recommend forcemerging down to a single segment before comparing as the size on disk can vary a lot for small data volumes if segment count and distribution differs.

---

<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, 2023, 5:40am UTC](https://discuss.elastic.co/t/disable-source-field/335434/6 "2023-07-06T05:40:13Z")

</div>

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