# Geo\_point object mapped to text field in elasticsearch

**URL:** <https://discuss.elastic.co/t/geo-point-object-mapped-to-text-field-in-elasticsearch/225263>\
**Category:** Elasticsearch\
**Created:** [March 26, 2020, 6:04pm UTC](https://discuss.elastic.co/t/geo-point-object-mapped-to-text-field-in-elasticsearch/225263 "2020-03-26T18:04:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jalil](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Jalil](https://discuss.elastic.co/u/Jalil)\
**Post date:** [March 26, 2020, 6:04pm UTC](https://discuss.elastic.co/t/geo-point-object-mapped-to-text-field-in-elasticsearch/225263/1 "2020-03-26T18:04:57Z")

</div>

Dear all,

I'm new on elasticseach and on this forum.  
I have a mongodb collection that contains objects whish contain geo\_point objects.  
When I index data from mongodb to elasticsearch using mongo-connector, the mapping and the index are created automaticcally and the geo\_point object is mapped to text, so I can't uss it in elasticsearch maps on kibana.

Here is an extract of my source objects called "locations" :

````auto
{ "_id" : ObjectId("5e70d49a2a907e356a367cf3"), 
       "organization_id" : "2", 
       "vehicle_id" : "5", 
       "dsn" : "1", 
       "vrn" : "Renault 9808TU161", 
       "fleet_id" : "14", 
       "driver_id" : null, 
       "driver_name" : null, 
       "reference_code" : "520190318142746", 
       "parent_id" : "520190318142746", 
       " **location**" : {
           "type" : "geo_point", 
           "coordinates" : {
               "lat" : 10.6421404, 
               "long" : 34.6872422
           }
       }, 
       "started_at" : ISODate("2019-03-18T14:27:46.000+0000"), 
       "started_in" : {
           "_id" : ObjectI etc.......```

And here is how it is mapped in elasticsearch : 

``` " **location**": {
                 "properties": {
                   "coordinates": {
                     "properties": {
                       "lat": {
                         "type": "float"
                       },
                       "long": {
                         "type": "float"
                       }
                     }
                   },
                   "name": {
                     "type": "text",
                     "fields": {
                       "keyword": {
                         "type": "keyword",
                         "ignore_above": 256
                       }
                     }
                   },
                   "type": {
                     "type": "text",
                     "fields": {
                       "keyword": {
                         "type": "keyword",
                         "ignore_above": 256
                       }
                     }
                   }
                 }
               }

````

Could you please help, why it is not recognized as geo\_point and how can I do ?

---

<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:** [March 26, 2020, 8:12pm UTC](https://discuss.elastic.co/t/geo-point-object-mapped-to-text-field-in-elasticsearch/225263/2 "2020-03-26T20:12:18Z")

</div>

Welcome!

You need to create the mapping before indexing documents.

---

<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:** [April 23, 2020, 8:12pm UTC](https://discuss.elastic.co/t/geo-point-object-mapped-to-text-field-in-elasticsearch/225263/3 "2020-04-23T20:12:29Z")

</div>

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