Skip to content

Instantly share code, notes, and snippets.

@aaronhelton
Created September 14, 2016 20:58
Show Gist options
  • Save aaronhelton/473b682da800da076091d418dbdf97c3 to your computer and use it in GitHub Desktop.
Save aaronhelton/473b682da800da076091d418dbdf97c3 to your computer and use it in GitHub Desktop.
{
"size": 0,
"aggs": {
"filtered": {
"filter": {
"match_all": {}
},
"aggs": {
"root": {
"nested": {
"path": "votes"
},
"aggs": {
"group": {
"terms": {
"field": "votes.country",
"min_doc_count": 5,
"shard_size": 10,
"size": 200
},
"aggs": {
"order": {
"terms": {
"field": "votes.vote"
}
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment