Skip to content

Instantly share code, notes, and snippets.

@mwdchang
Created March 18, 2015 21:19
Show Gist options
  • Save mwdchang/067c64097589d6983ed3 to your computer and use it in GitHub Desktop.
Save mwdchang/067c64097589d6983ed3 to your computer and use it in GitHub Desktop.
elasticsearch aggregation query
{
"size": 0,
"aggregations": {
"toplevel": {
"terms": {
"field": "_mutation_id",
"size": 10000
},
"aggs": {
"donor_distrubtion": {
"nested": {
"path": "ssm_occurrence"
},
"aggs": {
"set_distribution": {
"filters": {
"filters": {
"set1": {
"terms": {
"ssm_occurrence.donor._donor_id": [
"DO330",
"DO284",
"DO138"
]
}
},
"set2": {
"terms": {
"ssm_occurrence.donor._donor_id": [
"DO46443",
"DO44832",
"DO877"
]
}
}
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment