Long story short:
I have created a strict template, created several daily indices and changes one of the document types (%_level type from float to integer) in the template.
After that, I've created the rest of the daily indices.
The problem:
I need to change the document type (%_level type from float to integer) in the old indices to be compatible with the new indices. How can I do this?
Now for the details...
I have the following strict template:
PUT _template/example-template
{
"order":0,
"version":200,
"index_patterns":["example-*"],
"settings":{
"index":{
"number_of_shards":4
}
},
"mappings": {
"iterations": {
"dynamic":"strict",
"properties": {
"%_average1": {
"type":"float"
},
"%_average2": {
"type":"float"
},
"sum": {
"type":"integer"
},
"%_level": {
"type":"float"
}
}
}
}
}
Several indices were created with this template.
- example-20191220
- example-20191221
- example-20191222
- example-20191223
After a while I've realised that we need to change %_level type from float to integer, so I have changed the template into the following:
PUT _template/example-template
{
"order":0,
"version":200,
"index_patterns":["example-*"],
"settings":{
"index":{
"number_of_shards":4
}
},
"mappings": {
"iterations": {
"dynamic":"strict",
"properties": {
"%_average1": {
"type":"float"
},
"%_average2": {
"type":"float"
},
"sum": {
"type":"integer"
},
"%_level": {
"type":"integer"
}
}
}
}
}
Now the the following indices were created where %_level type is an integer.
- example-20192412
- example-20192512
- example-20192612
But the old indices contains indices with %_level that is float and the new indices are with %_level that is an integer.
I needed to convert the old indices %_level from float to integer so I can build a report with all the indices.
How can I change the %_level in the old indices from float to integer?