Skip to content

Instantly share code, notes, and snippets.

@jpountz
Created December 16, 2013 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jpountz/7986093 to your computer and use it in GitHub Desktop.
Save jpountz/7986093 to your computer and use it in GitHub Desktop.
aggs_filter.json
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