Search code examples
elasticsearchkibanaelasticsearch-5

i want to update the data type of fields in elasticsearch


I want to update the data type of fields I already created an index with data also visualization now want to update the data type of one field. I am doing this in the console of dev tools

I tried to do it but giving an error enter image description here


Solution

  • Since you're hitting the _mapping endpoint, you need to remove the mappings section in the payload and only have properties.

    However, once a field is created you cannot change its type, you need to recreate a new index with the proper mapping field type.

    UPDATE: If you need to set default values for your fields you can use the null_value mapping parameter.