# Date type automapping in 0.17.5

**URL:** <https://discuss.elastic.co/t/date-type-automapping-in-0-17-5/5144>\
**Category:** Elasticsearch\
**Created:** [August 13, 2011, 3:55am UTC](https://discuss.elastic.co/t/date-type-automapping-in-0-17-5/5144 "2011-08-13T03:55:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dottom](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dottom](https://discuss.elastic.co/u/dottom)\
**Post date:** [August 13, 2011, 3:55am UTC](https://discuss.elastic.co/t/date-type-automapping-in-0-17-5/5144/1 "2011-08-13T03:55:11Z")

</div>

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"
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [August 13, 2011, 8:22am UTC](https://discuss.elastic.co/t/date-type-automapping-in-0-17-5/5144/2 "2011-08-13T08:22:43Z")

</div>

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:

> <https://github.com/elastic/elasticsearch/issues/1241>
>
> 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

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 13, 2011, 10:27am UTC](https://discuss.elastic.co/t/date-type-automapping-in-0-17-5/5144/3 "2011-08-13T10:27:50Z")

</div>

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](mailto: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](https://github.com/elasticsearch/elasticsearch/issues/1241)
> 
> clint

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:57am UTC](https://discuss.elastic.co/t/date-type-automapping-in-0-17-5/5144/4 "2017-07-06T03:57:14Z")

</div>

Closed on July 6, 2017, 3:57am UTC


