Skip to content

Instantly share code, notes, and snippets.

@koryonik
Created September 27, 2016 12:40
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 koryonik/732d08da2864675cf95a67216f2b8292 to your computer and use it in GitHub Desktop.
Save koryonik/732d08da2864675cf95a67216f2b8292 to your computer and use it in GitHub Desktop.
Filter Aggregation With Multiple terms
{
"size": 0,
"aggs": {
"agg_name": {
"filter" : {
"bool": {
"must": [
{
"term": {
"field1": "VALUE1"
}
},
{
"term": {
"field2": "VALUE2"
}
}
]
}
},
"aggs" : {
"agg_name_filtered":{
"terms": {
"size": 50,
"field": "fieldname",
"missing": "N/A"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment