# Disable field index

**URL:** <https://discuss.elastic.co/t/disable-field-index/153950>\
**Category:** Elasticsearch\
**Created:** [October 25, 2018, 8:43am UTC](https://discuss.elastic.co/t/disable-field-index/153950 "2018-10-25T08:43:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hitesh-inbetween](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hitesh-inbetween](https://discuss.elastic.co/u/hitesh-inbetween)\
**Post date:** [October 25, 2018, 8:43am UTC](https://discuss.elastic.co/t/disable-field-index/153950/1 "2018-10-25T08:43:07Z")

</div>

Is it possible to toggle searchable field.  
My index contains around 3000 fields and 1200k documents, at times I see memory issues. On further analysis, I found that due to large number of fields, not all fields are available in the heap.  
I think, for my usecase, the probable solution will be to disable searching/indexing on fields that are marked as not searchable in my application.  
How ever, my application provides functionality to toggle the "Searchable" switch. This would mean that a field not searchable at a particular point of time, can become searchable at another point of time.

Is it possible though?

---

<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:** [October 25, 2018, 9:48am UTC](https://discuss.elastic.co/t/disable-field-index/153950/2 "2018-10-25T09:48:03Z")

</div>

It's not dynamic, no.

You could setup a multi-field, where one is indexed and the other is not. Then your app could query one or the other based on the switch.

---

<div class="post-metadata">

**Author:** ![hitesh-inbetween](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hitesh-inbetween](https://discuss.elastic.co/u/hitesh-inbetween)\
**Post date:** [October 25, 2018, 12:22pm UTC](https://discuss.elastic.co/t/disable-field-index/153950/3 "2018-10-25T12:22:47Z")

</div>

Hi Mark,

The idea is to reduce the load on memory. And I already have multi field for numeric, date and text field to handle different usecase where user can change the type of data a field will hold.

Any idea if this is possible?  
What I found online was to create a new index with the required field disabled and then reindex the data to the new index

---

<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:** [October 25, 2018, 9:35pm UTC](https://discuss.elastic.co/t/disable-field-index/153950/4 "2018-10-25T21:35:46Z")

</div>

That is another option.

---

<div class="post-metadata">

**Author:** ![hitesh-inbetween](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hitesh-inbetween](https://discuss.elastic.co/u/hitesh-inbetween)\
**Post date:** [October 30, 2018, 9:28am UTC](https://discuss.elastic.co/t/disable-field-index/153950/5 "2018-10-30T09:28:29Z")

</div>

Hi @warkolm ,

Any chance toggling fielddata on fields might do the trick?The doc [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html) happens to say something similar.

I am still trying this out.

---

<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:** [October 30, 2018, 8:56pm UTC](https://discuss.elastic.co/t/disable-field-index/153950/6 "2018-10-30T20:56:01Z")

</div>

Depends what version you are on, newer versions use less fielddata to reduce overall heap pressure.

How much of a problem is this though?

---

<div class="post-metadata">

**Author:** ![hitesh-inbetween](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hitesh-inbetween](https://discuss.elastic.co/u/hitesh-inbetween)\
**Post date:** [November 6, 2018, 9:53am UTC](https://discuss.elastic.co/t/disable-field-index/153950/7 "2018-11-06T09:53:39Z")

</div>

I am using 6.3.  
And from the docs, I can presume that this might work. Didn't get a chance to dig deeper into the implementation. ☹

---

<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:** [December 4, 2018, 9:53am UTC](https://discuss.elastic.co/t/disable-field-index/153950/8 "2018-12-04T09:53:48Z")

</div>

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