Skip to content

Instantly share code, notes, and snippets.

@aaronhelton
Created September 14, 2016 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronhelton/4c2ac869480ccb78a1b744b5984f3430 to your computer and use it in GitHub Desktop.
Save aaronhelton/4c2ac869480ccb78a1b744b5984f3430 to your computer and use it in GitHub Desktop.
{
"size": 0,
"aggs": {
"filtered": {
"filter": {
"nested": {
"path" : "votes",
"query": {
"bool": {
"must": [{
"match": {"votes.country": "CHINA"}
}]
}
}
}
},
"aggs": {
"root": {
"terms": {
"field": "body",
"min_doc_count": 5,
"shard_size": 10,
"size": 200
},
"aggs": {
"order": {
"terms": {
"field": "session"
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment