Aggregate max against date field returns unformatted date


(kti_sk) #1

queries such as
{
"aggs": {
"max_startTime": {
"max": {
"field": "startDate"
}
},
"min_startTime": {
"min": {
"field": "startDate"
}
}
}
}

return s140834239392... instead of nicely formatted date.
The field is maked as date type.
Am I using the query wrong? is there a way to 'cast' the data to date?

thanks

--
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/f5555dc5-1ca9-4140-b828-770389f38691%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Adrien Grand) #2

You are doing things right, it is just that the max aggregation doesn't
support this feature.

On Wed, Aug 20, 2014 at 8:56 PM, kti_sk@hotmail.com wrote:

queries such as
{
"aggs": {
"max_startTime": {
"max": {
"field": "startDate"
}
},
"min_startTime": {
"min": {
"field": "startDate"
}
}
}
}

return s140834239392... instead of nicely formatted date.
The field is maked as date type.
Am I using the query wrong? is there a way to 'cast' the data to date?

thanks

--
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/f5555dc5-1ca9-4140-b828-770389f38691%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/f5555dc5-1ca9-4140-b828-770389f38691%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
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/CAL6Z4j79zd9B9QeVMcED2Xay4_Mx7DLuz0w2y%3DL-YcTxBJsOQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3