# Geopoint type field in template is not recognized after upgrading to Elasticsearch 2.3.1

**URL:** <https://discuss.elastic.co/t/geopoint-type-field-in-template-is-not-recognized-after-upgrading-to-elasticsearch-2-3-1/48686>\
**Category:** Elasticsearch\
**Created:** [April 28, 2016, 2:06pm UTC](https://discuss.elastic.co/t/geopoint-type-field-in-template-is-not-recognized-after-upgrading-to-elasticsearch-2-3-1/48686 "2016-04-28T14:06:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharon.c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharon.c/32/16076_2.png) [@sharon.c](https://discuss.elastic.co/u/sharon.c)\
**Post date:** [April 28, 2016, 2:06pm UTC](https://discuss.elastic.co/t/geopoint-type-field-in-template-is-not-recognized-after-upgrading-to-elasticsearch-2-3-1/48686/1 "2016-04-28T14:06:02Z")

</div>

curl to submit the template  
curl -XPUT '[http://staging-elkstack:9200/\_template/elkstats\_template](http://staging-elkstack:9200/_template/elkstats_template)' -d '  
{  
"order" : 2,  
"template": "template\_test\*",  
"settings": {  
"number\_of\_shards" : 8,  
"number\_of\_replicas" : 0  
},  
"mappings" : {  
"log" : {  
"\_all" : {"enabled" : false, "omit\_norms" : true},  
"properties" : {  
"geopoint": {  
"type": "geo\_point"  
}  
}  
}  
}  
}  
'

logstash conf file

> 

input{stdin{}}  
filter {  
json { source =\> "message" }  
ruby {  
#generate geopoint field  
code =\> " event['geopoint'] = [event['longitude'], event['latitude'] ];  
"  
}  
}  
output {  
stdout { codec =\> rubydebug }  
elasticsearch {  
hosts =\> "staging-elkstack:9200"  
index =\> "template\_test"  
template\_name =\> "elkstats\_template"  
}  
}

input

> 

{ "longitude":-73.758, "latitude":41.0291}

response:

> 

{  
"message" =\> "{ "longitude":-73.758, "latitude":41.0291}",  
"@version" =\> "1",  
"@timestamp" =\> "2016-04-28T13:59:34.989Z",  
"host" =\> "staging-elkstack",  
"longitude" =\> -73.758,  
"latitude" =\> 41.0291,  
"geopoint" =\> [  
[0] -73.758,  
[1] 41.0291  
]  
}  
Failed action. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"template\_test", :\_type=\>"logs", :\_routing=\>nil}, #\<LogStash::Event:0x29a3fe4e @metadata\_accessors=#\<LogStash::Util::Accessors:0xaa19e3 @store={}, @lut={}\>, @cancelled=false, @data={"message"=\>"{ "longitude":-73.758, "latitude":41.0291}", "@version"=\>"1",  
...  
BigDecimal:ba3f33c,'-0.73758E2',5(8), "latitude"=\>#BigDecimal:127d81fd,'0.410291E2',6(8), "geopoint"=\>[#BigDecimal:ba3f33c,'-0.73758E2',5(8), #BigDecimal:127d81fd,'0.410291E2',6(8)]}, "latitude"], "geopoint"=\>[{"message"=\>"{ "longitude":-73.758, "latitude":41.0291}", "@version"=\>"1", "@timestamp"=\>"2016-04-28T13:59:34.989Z", "host"=\>"staging-elkstack", "longitude"=\>#BigDecimal:ba3f33c,'-0.73758E2',5(8), "latitude"=\>#BigDecimal:127d81fd,'0.410291E2',6(8), "geopoint"=\>[#BigDecimal:ba3f33c,'-0.73758E2',5(8), #BigDecimal:127d81fd,'0.410291E2',6(8)]}, "geopoint"], "type"=\>[{"message"=\>"{ "longitude":-73.758, "latitude":41.0291}", "@version"=\>"1", "@timestamp"=\>"2016-04-28T13:59:34.989Z", "host"=\>"staging-elkstack", "longitude"=\>#BigDecimal:ba3f33c,'-0.73758E2',5(8), "latitude"=\>#BigDecimal:127d81fd,'0.410291E2',6(8), "geopoint"=\>[#BigDecimal:ba3f33c,'-0.73758E2',5(8), #BigDecimal:127d81fd,'0.410291E2',6(8)]}, "type"]}\>\>], :response=\>{"create"=\>{"\_index"=\>"template\_test", "\_type"=\>"logs", "\_id"=\>"AVRdKu\_VWBYWdrvdTG5E", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse", "caused\_by"=\>{"type"=\>"illegal\_state\_exception", "reason"=\>"Mixing up field types: class org.elasticsearch.index.mapper.core.DoubleFieldMapper$DoubleFieldType != class org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper$GeoPointFieldType on field geopoint"}}}}, :level=\>:warn}

I am using elasticsearch 2.3.1 and logstash 2.2.4

---

<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:** [April 29, 2016, 12:33pm UTC](https://discuss.elastic.co/t/geopoint-type-field-in-template-is-not-recognized-after-upgrading-to-elasticsearch-2-3-1/48686/2 "2016-04-29T12:33:12Z")

</div>

> [@sharon.c](#):
>
> Failed action. {:status=\>400, :action=\>["index", {:id=\>nil, :index=\>"template\_test", :type=\>"logs",

Your mapping with the field of type `geo_point` is for type `log`, but you index your document with type `logs`, so it tries to add `geopoint` field as type `double`.

---

<div class="post-metadata">

**Author:** ![sharon.c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharon.c/32/16076_2.png) [@sharon.c](https://discuss.elastic.co/u/sharon.c)\
**Post date:** [April 29, 2016, 10:04pm UTC](https://discuss.elastic.co/t/geopoint-type-field-in-template-is-not-recognized-after-upgrading-to-elasticsearch-2-3-1/48686/3 "2016-04-29T22:04:40Z")

</div>

Thank you for your detailed observation, appreciate it.

---

<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 5, 2017, 10:55pm UTC](https://discuss.elastic.co/t/geopoint-type-field-in-template-is-not-recognized-after-upgrading-to-elasticsearch-2-3-1/48686/4 "2017-07-05T22:55:08Z")

</div>


