# Mapping geo\_point

**URL:** <https://discuss.elastic.co/t/mapping-geo-point/155956>\
**Category:** Elasticsearch\
**Created:** [November 8, 2018, 8:40pm UTC](https://discuss.elastic.co/t/mapping-geo-point/155956 "2018-11-08T20:40:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemon](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lemon](https://discuss.elastic.co/u/lemon)\
**Post date:** [November 8, 2018, 8:40pm UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/1 "2018-11-08T20:40:11Z")

</div>

Hi, i'm trying to put a custom index in order to change the type of my field [Geolocation] (currently is string) which contain coordinates like "42.12356,72.23523". When I put the mapping i have an error:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/8/d8c4885c651a80b17a2275135243e54ad2508557.png)  
My mapping for the field [Geolocation]:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/4/b4a0095b0f63011aaa77e27e56180a294211f4a5.png)  
To create the new mapping i indexed a sample of my data and i only modified the type of my field so i don't understand error ignore\_above as it works with dynamic mapping.  
Thank you in advance for your help.

---

<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:** [November 9, 2018, 10:34am UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/2 "2018-11-09T10:34:19Z")

</div>

That's not a valid mapping, see [https://www.elastic.co/guide/en/elasticsearch/reference/6.4/geo-point.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/geo-point.html)

Also please don't post pictures of text, they are difficult to read and some people may not be even able to see them.

---

<div class="post-metadata">

**Author:** ![lemon](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lemon](https://discuss.elastic.co/u/lemon)\
**Post date:** [November 9, 2018, 11:01am UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/3 "2018-11-09T11:01:09Z")

</div>

Thanks for your response and advises @warkolm . I have ever read the doc but i don't understand how to represent it in my custom mapping.  
I tried like this but it doesn't work  
"Geolocation": {  
"type": "geo\_point as a string",  
"norms": false,  
"fields": {  
"keyword": {  
"type": "geo\_point",  
"location": "lat,lon"  
"doc\_values": true,  
"ignore\_above": 256  
}  
}  
},  
Sorry for lost time.

---

<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:** [November 10, 2018, 12:25am UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/4 "2018-11-10T00:25:04Z")

</div>

It simply needs to be;

```auto
"Geolocation": {
  "type": "geo_point"
}

```

---

<div class="post-metadata">

**Author:** ![lemon](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lemon](https://discuss.elastic.co/u/lemon)\
**Post date:** [November 11, 2018, 3:17pm UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/5 "2018-11-11T15:17:00Z")

</div>

Thank you @warkolm. I modify my template as you suggest:  
"Geolocation": {  
"type": "geo\_point"  
},  
and i modify my logstash.conf like this:  
output {  
elasticsearch {  
hosts =\> "elasticsearch:9200"  
template =\> "/config-dir/custom\_mapping.json"  
manage\_template =\> true  
template\_overwrite =\> true  
index =\> "logstash-meta"  
It runs without any error but in my index the field Geolocation is always a string type. I test with the type "geo\_point as a string" because my field Geolocation is [43.12345,73.123456] but it doesn't work.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 11, 2018, 4:38pm UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/6 "2018-11-11T16:38:42Z")

</div>

Did you delete the index?

---

<div class="post-metadata">

**Author:** ![lemon](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lemon](https://discuss.elastic.co/u/lemon)\
**Post date:** [November 12, 2018, 8:20am UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/7 "2018-11-12T08:20:06Z")

</div>

Hello @dadoonet, yes I have deleted index before restart. For my tests I use a sample of data so I reindex the data for each test. My field "Geolocation" is a subfield extracted with a kv filter (with the option target =\> meta\_pictures) from a field "metadata", in the mapping (GET /myindex) the name is Geolocation but in the index management it appears as meta\_pictures.Geolocation. Thank you for your help.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 12, 2018, 8:36am UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/8 "2018-11-12T08:36:53Z")

</div>

Check with the GET template API that your template is correctly loaded in elasticsearch.

---

<div class="post-metadata">

**Author:** ![lemon](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lemon](https://discuss.elastic.co/u/lemon)\
**Post date:** [November 12, 2018, 8:51am UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/9 "2018-11-12T08:51:14Z")

</div>

The template seems not loaded. I run HEAD \_/template/logstash-_, the response is error 404 not found. If I run GET /\_template/logstash-meta the response is { }  
It should be an error in my json file but I'm not able to identify what is wrong with the documentation. The head of my json file is wrote as below:  
{  
"order": 0,  
"version": 60001,  
"index\_patterns": [  
"logstash-_"  
],  
"settings": {  
"index.number\_of\_replicas": "0",  
"index": {  
"refresh\_interval": "5s"  
}  
},  
"mappings": {  
"doc": {  
"properties": {  
"@timestamp": {  
"type": "date"  
},  
"@version": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 12, 2018, 10:49am UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/10 "2018-11-12T10:49:00Z")

</div>

Try to use manually the PUT template API.  
That will tell you. Like the remaining comma at the end?

Or check logstash logs

---

<div class="post-metadata">

**Author:** ![lemon](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lemon](https://discuss.elastic.co/u/lemon)\
**Post date:** [November 12, 2018, 1:12pm UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/11 "2018-11-12T13:12:59Z")

</div>

OK there were syntax errors in my json file and an error in the type. #noob Now it works. Thank you for your help and your time @dadoonet.

---

<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:** [December 10, 2018, 1:13pm UTC](https://discuss.elastic.co/t/mapping-geo-point/155956/12 "2018-12-10T13:13:00Z")

</div>

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