Trying to get the min / max dates for a query. Would aggregates be the
right way to do so? Should the min / max aggs respect the "format":
"date_time" property that date histogram does? The Sense query:
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" }
}
}
}
produces:
{
"took": 4474,
"timed_out": false,
"_shards": {
"total": 103,
"successful": 103,
"failed": 0
},
"hits": {
"total": 129870443,
"max_score": 1,
"hits": []
},
"aggregations": {
"max_time": {
"value": 1732417139462
},
"min_time": {
"value": 1386850080000
}
}
}
Which I know is a long response time - my laptop is pretty loaded up at the
moment. Gist @ https://gist.github.com/mikeasick/7964683
If this should be a bug or feature request, let me know and I'll create.
Advice much appreciated. Thanks --Mike
Michael Sick | Big Data Architect
Serene Software Inc.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAP8axnBG6oZBLkxczR%3DPgHFmcvwHU1VrT9PM5yHAa9eodzW%2BhA%40mail.gmail.com .
For more options, visit https://groups.google.com/groups/opt_out .
uboness1
(uboness)
December 16, 2013, 3:32pm
2
Hi Michael,
Yes, please open an official issue for it on github.
Thanks,
Uri
On Saturday, December 14, 2013 12:44:32 PM UTC-8, Michael Sick wrote:
Trying to get the min / max dates for a query. Would aggregates be the
right way to do so? Should the min / max aggs respect the "format":
"date_time" property that date histogram does? The Sense query:
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" }
}
}
}
produces:
{
"took": 4474,
"timed_out": false,
"_shards": {
"total": 103,
"successful": 103,
"failed": 0
},
"hits": {
"total": 129870443,
"max_score": 1,
"hits":
},
"aggregations": {
"max_time": {
"value": 1732417139462
},
"min_time": {
"value": 1386850080000
}
}
}
Which I know is a long response time - my laptop is pretty loaded up at
the moment. Gist @ Can't get ElasticSearch minimum / maximum aggregations (aggs) to respect date formatting · GitHub
If this should be a bug or feature request, let me know and I'll create.
Advice much appreciated. Thanks --Mike
Michael Sick | Big Data Architect
Serene Software Inc.
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f27a8402-d425-4bb3-9390-2e8b3a42cf7c%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Done - thanks!
opened 05:25PM - 16 Dec 13 UTC
closed 05:33PM - 24 Dec 14 UTC
The query below with an aggregate on any date field will not respect the "format… " property that date histogram supports.
curl -XGET http://localhost:9200/vitals/vital/_search?pretty=true -d '
{
"size": 0,
"query": {
"match_all": {}
},
"aggs": {
"minimum_vitals_datetime" : {
"min" : {
"field" : "recorded_time",
"format": "date_time"
}
}
}
}'
result is:
{
"took" : 2342,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 67733027,
"max_score" : 1.0,
"hits" : [ ]
},
"aggregations" : {
"minimum_vitals_datetime" : {
"value" : 1.38685008E12
}
}
}
without a formatted version.
On Mon, Dec 16, 2013 at 10:32 AM, uboness uri.boness@elasticsearch.com wrote:
Hi Michael,
Yes, please open an official issue for it on github.
Thanks,
Uri
On Saturday, December 14, 2013 12:44:32 PM UTC-8, Michael Sick wrote:
Trying to get the min / max dates for a query. Would aggregates be the
right way to do so? Should the min / max aggs respect the "format":
"date_time" property that date histogram does? The Sense query:
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" }
}
}
}
produces:
{
"took": 4474,
"timed_out": false,
"_shards": {
"total": 103,
"successful": 103,
"failed": 0
},
"hits": {
"total": 129870443,
"max_score": 1,
"hits":
},
"aggregations": {
"max_time": {
"value": 1732417139462
},
"min_time": {
"value": 1386850080000
}
}
}
Which I know is a long response time - my laptop is pretty loaded up at
the moment. Gist @ Can't get ElasticSearch minimum / maximum aggregations (aggs) to respect date formatting · GitHub
If this should be a bug or feature request, let me know and I'll create.
Advice much appreciated. Thanks --Mike
Michael Sick | Big Data Architect
Serene Software Inc.
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/f27a8402-d425-4bb3-9390-2e8b3a42cf7c%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out .
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAP8axnBMHe-pRGhTfVvso8_htV3FnKP8gU0Qez9ChAdxstd31w%40mail.gmail.com .
For more options, visit https://groups.google.com/groups/opt_out .