Key_as_string formating glued to key

Hi,

I'm doing some experiments on elasticsearch as it looks a very promising solution in our system. While trying to do some date aggregation I've noticed some odd behavior when trying to format date

{
"aggs": {
"events": {
"date_histogram": {
"field": "@timestamp",
"interval": "1d",
"min_doc_count": 0,
"format" : "yyyy-mm-dd"
}
}
}
}

I get following response:

{
"aggregations": {
"events": {
"buckets": [
{
"key_as_string": "yyyy-mm-dd1412467200000",
"key": 1412467200000,
"doc_count": 22
},
{
"key_as_string": "yyyy-mm-dd1412553600000",
"key": 1412553600000,
"doc_count": 451
}
]
}
}
}

Elastic search version:

"version" : {
"number" : "1.3.2",
"build_hash" : "dee175dbe2f254f3f26992f5d7591939aaefd12f",
"build_timestamp" : "2014-08-13T14:29:30Z",
"build_snapshot" : false,
"lucene_version" : "4.9"
}

Maybe I'm missing some config's? Elasticsearch is completely new experience for me and it's documentation is far from complete.

At least, you should open an issue and concatenating the format with the value is not what we should do! :slight_smile:

Still, your date format is incorrect. You should use: yyyy-MM-dd I think.

--
David Pilato | Technical Advocate | elasticsearch.com
david.pilato@elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 7 octobre 2014 à 10:57:43, TJ (tautvydas@greitai.lt) a écrit:

Hi,

I'm doing some experiments on elasticsearch as it looks a very promising
solution in our system. While trying to do some date aggregation I've
noticed some odd behavior when trying to format date

{
"aggs": {
"events": {
"date_histogram": {
"field": "@timestamp",
"interval": "1d",
"min_doc_count": 0,
"format" : "yyyy-mm-dd"
}
}
}
}

I get following response:

{
"aggregations": {
"events": {
"buckets": [
{
"key_as_string": "yyyy-mm-dd1412467200000",
"key": 1412467200000,
"doc_count": 22
},
{
"key_as_string": "yyyy-mm-dd1412553600000",
"key": 1412553600000,
"doc_count": 451
}
]
}
}
}

Elastic search version:

"version" : {
"number" : "1.3.2",
"build_hash" : "dee175dbe2f254f3f26992f5d7591939aaefd12f",
"build_timestamp" : "2014-08-13T14:29:30Z",
"build_snapshot" : false,
"lucene_version" : "4.9"
}

Maybe I'm missing some config's? Elasticsearch is completely new experience
for me and it's documentation is far from complete.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/key-as-string-formating-glued-to-key-tp4064499.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
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/1412672260364-4064499.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.

--
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/etPan.5433b262.22221a70.7bd4%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/d/optout.