Attempted nested aggregations claiming that document isn't nested


(Andrew Nisbet) #1

Hi, I am having an issue with a nested document query, that hopefully someone can help me with. I have verified that the mapping indicates that target object is described as a nested object. my aggregation in the query looks like this(full query is pretty big, so I am not including it for now)

{"resolutions": {
"terms": {
"field": "publish_actions.status"
},
"aggs": {
"publish_actions": {
"nested": {
"path": "publish_actions"
},
"aggs": {
"current_status": {
"top_hits": {
"sort": [
{
"publish_actions.published_at": {
"order": "desc"
}
}
],
"size": 1
}
}}}
}}}

the yields the following response:

{
"error": {
"root_cause": [
{
"type": "aggregation_execution_exception",
"reason": "[nested] nested path [publish_actions] is not nested"
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "new_es_perf_test_20160222",
"node": "PUpvsGOuTai5HeP9SUX0eA",
"reason": {
"type": "aggregation_execution_exception",
"reason": "[nested] nested path [publish_actions] is not nested"
}
}
]
},
"status": 500
}

somewhat lost, at this point, any guidance would be greatly appreciated.

Thank you.


(system) #2