Skip to content

Instantly share code, notes, and snippets.

@darklow
Forked from jpountz/aggs_filter.json
Created December 16, 2013 13:42
Show Gist options
  • Save darklow/7987075 to your computer and use it in GitHub Desktop.
Save darklow/7987075 to your computer and use it in GitHub Desktop.
curl -XGET "http://localhost:9200/movies/_search" -d'
{
"query": {
"nested": {
"path": "credits",
"query": {
"match": {
"credits.person_id": 1
}
}
}
},
"aggs": {
"comedy": {
"filter": {
"term": {
"genre": "comedy"
}
},
"aggs": {
"credit": {
"nested": {
"path": "credits"
},
"aggs": {
"department": {
"terms": {
"field": "department"
}
}
}
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment