Disable field index

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?

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.

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

That is another option.

Hi @warkolm ,

Any chance toggling fielddata on fields might do the trick?The doc here happens to say something similar.

I am still trying this out.

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

How much of a problem is this though?

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. :frowning:

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