# Elasticsearch throw error on mappings

**URL:** <https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232>\
**Category:** Elasticsearch\
**Created:** [August 7, 2018, 2:39am UTC](https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232 "2018-08-07T02:39:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjaiwenwen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjaiwenwen/32/34182_2.png) [@cjaiwenwen](https://discuss.elastic.co/u/cjaiwenwen)\
**Post date:** [August 7, 2018, 2:39am UTC](https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232/1 "2018-08-07T02:39:25Z")

</div>

Hi Team

I am running on Elasticsearch 6.3, i am generate some geo-data from my script to elasticsearch through Elasticsearch python API.

my geo-point mapping according to [https://www.elastic.co/guide/en/elasticsearch/reference/6.x/geo-point.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/geo-point.html)

```
mappings = {
   "_doc": {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
   }
}

```

So first thing i am doing is to create indices by es.indices.create(index='dns\_data', body=mappings)

And i am getting following error, anything wrong with my code?

TransportError(400, u'illegal\_argument\_exception', u'unknown setting [index.\_doc.properties.location.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings')

Regards  
Chen Jun

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 7, 2018, 3:15am UTC](https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232/2 "2018-08-07T03:15:01Z")

</div>

I think the content of `mappings` should be quoted, right?

---

<div class="post-metadata">

**Author:** ![cjaiwenwen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjaiwenwen/32/34182_2.png) [@cjaiwenwen](https://discuss.elastic.co/u/cjaiwenwen)\
**Post date:** [August 7, 2018, 3:20am UTC](https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232/3 "2018-08-07T03:20:45Z")

</div>

Hi Mark,

Thanks for your reply ..

You mean something like this?

mappings = {  
"mappings": {  
"\_doc": {  
"properties": {  
"location": {  
"type": "geo\_point"  
}  
}  
}  
}  
}

and

es.indices.create(index='dns\_data', body=mappings)

Is that right?

---

<div class="post-metadata">

**Author:** ![cjaiwenwen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjaiwenwen/32/34182_2.png) [@cjaiwenwen](https://discuss.elastic.co/u/cjaiwenwen)\
**Post date:** [August 7, 2018, 3:38am UTC](https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232/4 "2018-08-07T03:38:26Z")

</div>

Hi Mark,

I have get it working, thanks for your advice!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 7, 2018, 3:45am UTC](https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232/5 "2018-08-07T03:45:58Z")

</div>

Can you share your solution, it might help someone in future 🙂

---

<div class="post-metadata">

**Author:** ![cjaiwenwen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjaiwenwen/32/34182_2.png) [@cjaiwenwen](https://discuss.elastic.co/u/cjaiwenwen)\
**Post date:** [August 7, 2018, 5:55am UTC](https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232/6 "2018-08-07T05:55:40Z")

</div>

Hi Mark,

I am using following mapping, and i thought i

mappings = {  
"mappings": {  
"\_doc": {  
"properties": {  
"location": {  
"type": "geo\_point"  
}  
}  
}  
}  
}

then use this mapping to create an indice "es.indices.create(index='dns\_data', body=mappings)"

After that when post the location value over use following format, should be able to get the geo\_point at elasticsearch index..  
{'location':[{'lat':latitude, 'lon':longitude}]}

---

<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:** [September 4, 2018, 5:56am UTC](https://discuss.elastic.co/t/elasticsearch-throw-error-on-mappings/143232/7 "2018-09-04T05:56:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
