In elasticsearch head I run query for retriving some aggregations. To do it, I need to get some infos from ctx variable. In my script when I try to use: ctx._source I get nullPointerException.
"aggregations": {
"fieldId": {
"terms": {
"script": {
"source": "... <Here I want to get ctx._source but I get null pointer>... ,
"lang": "painless"
},
...
]
}
}
}