dottom
(dottom)
August 13, 2011, 3:55am
1
Looks like auto type mapping is not working for date types in 0.17.5,
it shows up as "string":
# check version
$ elasticsearch -v
ElasticSearch Version: 0.17.5 (2011-08-12T12:13:16), JVM: 20.1-b02
# index something
$ curl -XPOST 'localhost:9200/twitter/tweet/' -d ' { "message" :
"hello world", "post_date" : "2011/08/12 01:23:45" }'
# check mappings
$ curl -XGET http://localhost:9200/twitter/tweet/_mapping?pretty=true
{
"tweet" : {
"properties" : {
"message" : {
"type" : "string"
},
"post_date" : {
"type" : "string"
}
}
}
}
Try it in 0.17.4:
# check version
$ elasticsearch -v
ElasticSearch Version: 0.17.4 (2011-08-04T20:57:57), JVM: 20.1-b02
# index something
$ curl -XPOST 'localhost:9200/twitter/tweet/' -d ' { "message" :
"hello world", "post_date" : "2011/08/12 01:23:45" }'
# check mappings
$ curl -XGET http://localhost:9200/twitter/tweet/_mapping?pretty=true
{
"tweet" : {
"properties" : {
"message" : {
"type" : "string"
},
"post_date" : {
"format" : "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd",
"type" : "date"
}
}
}
}
Hiya
On Fri, 2011-08-12 at 20:55 -0700, Tom Le wrote:
Looks like auto type mapping is not working for date types in 0.17.5,
it shows up as "string":
I've opened an issue:
opened 08:22AM - 13 Aug 11 UTC
closed 10:08AM - 13 Aug 11 UTC
v0.18.0
v0.17.6
Issue #1181 has broken detection of dates without timezones:
Couldn't the defau… lt format be: `"yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z||yyyy/MM/dd HH:mm:ss||yyyy/MM/dd"`
```
# [Sat Aug 13 10:20:10 2011] Protocol: http, Server: 192.168.5.103:9200
curl -XPOST 'http://127.0.0.1:9200/twitter/tweet?pretty=1' -d '
{
"date_2" : "2011/08/13 11:00:00 +00",
"date_1" : "2011/08/13 11:00:00"
}
'
# [Sat Aug 13 10:20:11 2011] Response:
# {
# "ok" : true,
# "_index" : "twitter",
# "_id" : "WYTlC0okR4itAoLeAsZ39w",
# "_type" : "tweet",
# "_version" : 1
# }
# [Sat Aug 13 10:20:13 2011] Protocol: http, Server: 192.168.5.103:9200
curl -XGET 'http://127.0.0.1:9200/twitter/_mapping?pretty=1'
# [Sat Aug 13 10:20:13 2011] Response:
# {
# "twitter" : {
# "tweet" : {
# "properties" : {
# "date_2" : {
# "format" : "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z",
# "type" : "date"
# },
# "date_1" : {
# "type" : "string"
# }
# }
# }
# }
# }
```
clint
kimchy
(Shay Banon)
August 13, 2011, 10:27am
3
Yea., thats a problem. Damn..., a 0.17.6 is on the way...
On Sat, Aug 13, 2011 at 11:22 AM, Clinton Gormley clint@traveljury.com wrote:
Hiya
On Fri, 2011-08-12 at 20:55 -0700, Tom Le wrote:
Looks like auto type mapping is not working for date types in 0.17.5,
it shows up as "string":
I've opened an issue:
Date detection for `YYYY/MM/dd` or `YYYY/MM/dd HH:mm:ss` without timezones now broken · Issue #1241 · elastic/elasticsearch · GitHub
clint