Elasticsearch field as searchable/not searchable

Viewed 10

I have a situation where I'd sometimes turn off whether a field is searchable or not, and for that I tried to use index when posting to mapping.

{
    "properties": {
        "test": {
            "type": "text",
            "index": false
        }
    }
}

I've found that it's not possible to switch index to true later once it's set to false. Same goes for store. Is there any other way to achieve this?

1 Answers

Nope, it's generally not possible to modify a mapping once it's been created. There are just a few settings that you can change but not the ones you mentioned.

Related