Naresh Singh
Naresh Singh

Reputation: 187

can we apply enabled settings to already exist field of any index in Elasticsearch

Hi I am new to elasticsearch. can we apply or update enabled settings of already exist field of any index in Elasticsearch. if yes, please help with that. i try this doc https://www.elastic.co/guide/en/elasticsearch/reference/6.8/enabled.html of elasticsearch. but getting exception resource already exist.

Upvotes: 0

Views: 233

Answers (1)

Jaycreation
Jaycreation

Reputation: 2089

You can update some settings (like the number of replicas) but not analyzer nor number of shards. and add new mappings but not modify an existing one. So you can add a new field or a new type on an existing field.

If you want to add enable: false on a new object never used in your mapping before you can:

PUT test/_mapping
{
  "properties": {
    "meta-datas": {
      "enabled": false
    }
  }
}

But if you want to "disable" an existing object, you'll have to create a new index, prepare your mapping, reindex in this new index, then delete the first one.

Upvotes: 1

Related Questions