# Need some help setting up geo indexes

**URL:** <https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509>\
**Category:** Elasticsearch\
**Created:** [June 26, 2018, 9:04pm UTC](https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509 "2018-06-26T21:04:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nos\_0](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@nos\_0](https://discuss.elastic.co/u/nos_0)\
**Post date:** [June 26, 2018, 9:04pm UTC](https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509/1 "2018-06-26T21:04:46Z")

</div>

Hello,

I am an elasticsearch noob and am trying to use the wikivoyage index dump (which uses elasticsearch 5.5.2) provided by wikipedia to do some geo queries. After bulk uploading their index in my local instance of elastic I see this in the mappings of the index that gets auto generated  
"coordinates" : {  
"properties" : {  
"coord" : {  
"properties" : {  
"lat" : {"type" : "float"},  
"lon" : {"type" : "float"  
}  
}  
},  
"dim" : {  
"type" : "long"  
},  
"globe" : {  
"type" : "text",  
"fields" : {  
"keyword" : {  
"type" : "keyword",  
"ignore\_above" : 256  
}  
}  
},  
"primary" : {  
"type" : "boolean"  
}  
}  
},

Now I want to run the geo distace query based on the example here -  
[https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-dsl-geo-distance-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/query-dsl-geo-distance-query.html)

Do I need to do some remapping of the current coordinate field of my index? It looks like I need to create a new geopoint type field or maybe modify the coordinate field to use this geopoint type. Is that right? And any help on how I do that would be greatly appreciated. Thank!

---

<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:** [June 26, 2018, 11:17pm UTC](https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509/2 "2018-06-26T23:17:42Z")

</div>

> [@nos\_0](#):
>
> "coord" : {  
> "properties" : {  
> "lat" : {"type" : "float"},  
> "lon" : {"type" : "float"  
> }  
> }

That should be mapped as a geopoint - [Geo-point datatype | Elasticsearch Reference [5.5] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/geo-point.html)

The best option would be to apply the mapping before uploading the data dump.

---

<div class="post-metadata">

**Author:** ![nos\_0](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@nos\_0](https://discuss.elastic.co/u/nos_0)\
**Post date:** [June 27, 2018, 3:30pm UTC](https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509/3 "2018-06-27T15:30:17Z")

</div>

Thanks! This is what I ended up doing. It wasn't clear from the docs - after a mapping is autogenerated (via bulk import of data) how to update/fix the mapping.

For something like the full wikipedia index import (where I don't have any prior idea what the fields and types are - and they seem to vary from dump to dump) looks like the process is - create index - figure out what needs changing in mappings - delete index - create new index with new mappings.

---

<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:** [June 27, 2018, 10:22pm UTC](https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509/4 "2018-06-27T22:22:37Z")

</div>

I don't know the dataset in question, but you should see if it comes with a template/mapping as well as the data dump itself.

---

<div class="post-metadata">

**Author:** ![nos\_0](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@nos\_0](https://discuss.elastic.co/u/nos_0)\
**Post date:** [June 28, 2018, 10:18pm UTC](https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509/5 "2018-06-28T22:18:05Z")

</div>

I am using their wikivoyage dump enwikivoyage-20180625-cirrussearch-content.json.gz from [here](https://dumps.wikimedia.org/other/cirrussearch/current/)

They do have an api to retrieve the settings and mappings  
[https://en.wikivoyage.org/w/api.php?action=cirrus-mapping-dump&format=json&formatversion=2](https://en.wikivoyage.org/w/api.php?action=cirrus-mapping-dump&format=json&formatversion=2) but it seem to be of 2.x format. The version of the dump as far as i can tell is 5.5.2. I have posted a question on their forum but haven't heard anything back. Trying to use the 2.x mappings gives me a bazillion errors. So I am plodding my way through it trying to figure out which objects map to 5.5.2.

---

<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:** [June 28, 2018, 10:42pm UTC](https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509/6 "2018-06-28T22:42:06Z")

</div>

Ahh yeah, looks like they have multiple types there, which won't work with 6.X anyway ☹

---

<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 26, 2018, 10:42pm UTC](https://discuss.elastic.co/t/need-some-help-setting-up-geo-indexes/137509/7 "2018-07-26T22:42:10Z")

</div>

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