Skip to content

Instantly share code, notes, and snippets.

@mikeasick
Created December 14, 2013 20:42
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 mikeasick/7964683 to your computer and use it in GitHub Desktop.
Save mikeasick/7964683 to your computer and use it in GitHub Desktop.
Can't get ElasticSearch minimum / maximum aggregations (aggs) to respect date formatting
GET /vitals/vital/_search
{
"size": 0,
"query": {
"match_all": {}
},
"aggs": {
"min_time" : {
"min" : {
"field" : "recorded_time",
"format": "date_time"
}
},
"max_time" : {
"max" : { "field" : "recorded_time" }
}
}
}
{
"took": 3942,
"timed_out": false,
"_shards": {
"total": 133,
"successful": 133,
"failed": 0
},
"hits": {
"total": 172800001,
"max_score": 1,
"hits": []
},
"aggregations": {
"max_time": {
"value": 1732417139462
},
"min_time": {
"value": 1386850080000
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment