In ElasticSearch, I have some nested data structured as follows:
{
"hello_metadata": {
"stuff": "123",
"apple": "23423"
},
"aksdjj_metadata": {
"stuff": "ppppppp",
"apple": "ddddddd"
}
}
I need to be able to add new fields to the mapping of all objects that match a certain phrase, in this case "_metadata".
For example, if I wanted to add a new field named "cheese" of type "text" to all objects containing the phrase "_metadata", then I would end up with:
{
"hello_metadata": {
"stuff": "123",
"apple": "23423",
"cheese": "akjsdadad"
},
"aksdjj_metadata": {
"stuff": "ppppppp",
"apple": "ddddddd",
"cheese": "L"
}
}
Is there any way to do this using the [Update Mapping API][1]?
I cannot re-create the Index, I must UPDATE it so I do not believe I can use the Dynamic Templates. [1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#indices-put-mapping