Home > Back-end >  Elasticsearch field as searchable/not searchable
Elasticsearch field as searchable/not searchable

Time:09-24

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?

CodePudding user response:

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