Skip to content

Instantly share code, notes, and snippets.

@arion
Last active November 16, 2016 06:25
Show Gist options
  • Save arion/9525840 to your computer and use it in GitHub Desktop.
Save arion/9525840 to your computer and use it in GitHub Desktop.
curl -XGET http://localhost:9200/store_development_products/_search -d '
{
"aggs": {
"category_ids": {
"terms": {
"field": "root_category_ids",
"size": 1000
},
"aggs" : {
"by_product_type": {
"terms": {
"field": "product_type",
"size": 4
}
}
}
}
}
}'
# "aggregations" : {
# "category_ids": {
# "buckets" : [
# {
# "key" : 1446,
# "doc_count" : 1018,
# "by_product_type" : {
# "buckets" : [
# {"key":"chapter","doc_count":903},
# {"key":"remix","doc_count":80},
# {"key":"book","doc_count":35}
# ]
# }
# },
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment