# Trying to create geo\_point index: Root type mapping not empty after parsing! Remaining field

**URL:** <https://discuss.elastic.co/t/trying-to-create-geo-point-index-root-type-mapping-not-empty-after-parsing-remaining-field/20090>\
**Category:** Elasticsearch\
**Created:** [October 6, 2014, 3:18pm UTC](https://discuss.elastic.co/t/trying-to-create-geo-point-index-root-type-mapping-not-empty-after-parsing-remaining-field/20090 "2014-10-06T15:18:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Bergman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_bergman/32/1234_2.png) [@Ryan\_Bergman](https://discuss.elastic.co/u/Ryan_Bergman)\
**Post date:** [October 6, 2014, 3:18pm UTC](https://discuss.elastic.co/t/trying-to-create-geo-point-index-root-type-mapping-not-empty-after-parsing-remaining-field/20090/1 "2014-10-06T15:18:06Z")

</div>

Hi,  
I have an index with data that looks like this:  
{  
"id":"52534",  
"name":"foo",  
"location":{  
"lat":39.18552295869955,  
"lon":-104.34581946342342  
}  
}

I'm attempting to make a mapping for the lat/lon field so I can do  
geospatial filters. However I get a weird error when attempting to make the  
mapping:

PUT [http://localhost:9200/foos/foo/\_mapping](http://localhost:9200/foos/foo/_mapping)  
{  
"mappings":  
{  
"location" : {  
"properties" : {  
"location" : {  
"type" : "geo\_point"  
}  
}  
}  
}  
}

which results in  
{  
error: "MapperParsingException[Root type mapping not empty after parsing!  
Remaining fields: [mappings :  
{location={properties={location={type=geo\_point}}}}]]"  
status: 400  
}

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7c512fd7-cb46-4737-8e87-d8381c9035ae%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7c512fd7-cb46-4737-8e87-d8381c9035ae%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [October 7, 2014, 7:54am UTC](https://discuss.elastic.co/t/trying-to-create-geo-point-index-root-type-mapping-not-empty-after-parsing-remaining-field/20090/2 "2014-10-07T07:54:30Z")

</div>

When using the put mapping API you do not need to have a `mappings` object.  
Also the type you are defining the mappings for should match the type in  
the URL. Your request should work if you try the following:

PUT [http://localhost:9200/foos/foo/\_mapping](http://localhost:9200/foos/foo/_mapping)  
{  
"foo" : {  
"properties" : {  
"location" : {  
"type" : "geo\_point"  
}  
}  
}  
}

See here  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html#indices-put-mapping](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html#indices-put-mapping)  
for more information on the put mapping API.

On Monday, 6 October 2014 16:18:07 UTC+1, Ryan Bergman wrote:

> Hi,  
> I have an index with data that looks like this:  
> {  
> "id":"52534",  
> "name":"foo",  
> "location":{  
> "lat":39.18552295869955,  
> "lon":-104.34581946342342  
> }  
> }
> 
> I'm attempting to make a mapping for the lat/lon field so I can do  
> geospatial filters. However I get a weird error when attempting to make the  
> mapping:
> 
> PUT [http://localhost:9200/foos/foo/\_mapping](http://localhost:9200/foos/foo/_mapping)  
> {  
> "mappings":  
> {  
> "location" : {  
> "properties" : {  
> "location" : {  
> "type" : "geo\_point"  
> }  
> }  
> }  
> }  
> }
> 
> which results in  
> {  
> error: "MapperParsingException[Root type mapping not empty after parsing!  
> Remaining fields: [mappings :  
> {location={properties={location={type=geo\_point}}}}]]"  
> status: 400  
> }

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f6dfc5a2-c794-4a03-a563-0ee46bd7a626%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f6dfc5a2-c794-4a03-a563-0ee46bd7a626%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:57am UTC](https://discuss.elastic.co/t/trying-to-create-geo-point-index-root-type-mapping-not-empty-after-parsing-remaining-field/20090/3 "2017-07-06T00:57:58Z")

</div>


