Skip to content

Instantly share code, notes, and snippets.

@ppearcy
Created September 11, 2014 18:01
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 ppearcy/0c6a86ebf32a0bbcb1fc to your computer and use it in GitHub Desktop.
Save ppearcy/0c6a86ebf32a0bbcb1fc to your computer and use it in GitHub Desktop.
{
"query" : {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"bool": {
"must": [
{"term": {
"courseUuid": "{{courseUuid}}"
}}
]
}
}
}
},
"size" : 0,
"aggs" : {
"{{field_name}}" : {
"terms": {
"field": "{{field_name}}",
"size": 10000
}, "aggs": {
"{{time_interval}}": {
"date_histogram": {
"field": "time",
"interval": "{{time_interval}}",
"min_doc_count": 0
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment