I need to iterate over nested objects on painless script_fields for my query but notation doc['nestedProperty.property'] does not gave me the value, neither does using array notation doc['nestedProperty.property'][0]
A document example:
{
"neestedProperty": [
{
"property": 12,
"innerNeestedProperty": {
"innerProperty1": 45,
"innerProperty2": -45
}
}
]
}
example query:
{
"query": {
match_all: {}
},
"script_fields": {
"scripted": {
"script": {
"inline": "doc['neestedProperty.property'] * params.multiplier",
"params": {
"multiplier": 100
},
"lang": "painless"
}
}
}
}
Any idea on how to use this? Thanks