Hi... I have a nested mapping, which I'd like to reindex into a non-nested structure - i.e. each nested object + the 'parent' document becomes a new document. Is this possible by reindexing? I'd like to avoid reloading from the source ideally.
I've had a good play about and a google but haven't come across any winning combination yet...
Existing mapping is:
{
"mappings" : {
"properties" : {
"wsid" : {
"type" : "keyword"
},
"date" : {
"type" : "date",
"index" : false
},
"md" : {
"type" : "short"
},
"year" : {
"type" : "short",
"index" : false
},
"obs" : {
"type" : "nested",
"properties" : {
"hr" : {
"type" : "byte"
},
"precipmm" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 100.0
},
"tempc" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 10.0
},
"snowcm" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 100.0
},
"sunmins" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 10.0
},
"cloudpct" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 100.0
},
"windkph" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 100.0
}
}
}
}
}
and what I'd like to get to:
{
"mappings" : {
"properties" : {
"wsid" : {
"type" : "keyword"
},
"date" : {
"type" : "date",
"index" : false
},
"md" : {
"type" : "short"
},
"year" : {
"type" : "short",
"index" : false
},
"hr" : {
"type" : "byte"
},
"precipmm" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 100.0
},
"tempc" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 10.0
},
"snowcm" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 100.0
},
"sunmins" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 10.0
},
"cloudpct" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 100.0
},
"windkph" : {
"type" : "scaled_float",
"index" : true,
"scaling_factor" : 100.0
}
}
}
}