I'm trying to store this kind of data inside an Elasticsearch index
{
"id": "5644596f9bf67301645999d9",
"headline": "Scientists Look Beyond Solar System to Study Planet",
"renditions": {
"baseImage": {
"height": 933,
"href": "www.imgur.com/animage",
"mimetype": "image/jpeg",
"width": 1400
},
"preview": {
"height": 500,
"href": "www.imgur.com/animage",
"mimetype": "image/jpeg",
"width": 400
},
"thumbnail": {
"height": 150,
"href": "www.imgur.com/animage",
"mimetype": "image/jpeg",
"width": 125
}
}
}
However the mapping keeps adding unique blocks for all the different children of "renditions".
Ideally, I would define a type of child for "renditions" then assert that all objects under it should be like that.
Is this possible?
I've looked into Dynamic Mappings but I've got a bit confused with it all...
"renditions":[{ "key_name": "thumbnail", "value": {...} },...], maybe. In that case you would probably want to use anestedtype.