# Error: can’t merge a non object mapping with an object mapping

**URL:** <https://discuss.elastic.co/t/error-can-t-merge-a-non-object-mapping-with-an-object-mapping/276773>\
**Category:** Logstash\
**Created:** [June 23, 2021, 10:24am UTC](https://discuss.elastic.co/t/error-can-t-merge-a-non-object-mapping-with-an-object-mapping/276773 "2021-06-23T10:24:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jofr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jofr/32/90691_2.png) [@jofr](https://discuss.elastic.co/u/jofr)\
**Post date:** [June 23, 2021, 10:24am UTC](https://discuss.elastic.co/t/error-can-t-merge-a-non-object-mapping-with-an-object-mapping/276773/1 "2021-06-23T10:24:53Z")

</div>

Somehow I can not define a geo\_point field type in the Elasticsearch mapping and then import data with Logstash. The details are described here in this [Stackoverflow question](https://stackoverflow.com/questions/68094162/elasticsseach-can-t-merge-a-non-object-mapping-with-an-object-mapping).

If I do not define an Elasticsearch mapping then the data is imported in Elasticsearch just fine and the mapping is automatically inferred from the data. The only problem is that the location field has not the right field type "geo\_point" which is apparently needed for geographic queries. If I define a "geo\_point" field in the mapping when I create the index, then Logstash refuses to import the data. The error message is "can’t merge a non object mapping [location] with an object mapping". What can I do to get it working? I do not know what else I could try to get it working.

The basic task is to define the right "geo\_point" field type for a location field which has  
latitude and longitude coordinates. In the original JSON data we have the following "location" field:

```auto
"location": { 
  "lat": 41.12,
  "lng": -71.34
}

```

How can we import this data in Elasticsearch using Logstash so that the "location" field has the field\_type "geo\_point" ?

---

<div class="post-metadata">

**Author:** ![jofr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jofr/32/90691_2.png) [@jofr](https://discuss.elastic.co/u/jofr)\
**Post date:** [June 30, 2021, 7:45am UTC](https://discuss.elastic.co/t/error-can-t-merge-a-non-object-mapping-with-an-object-mapping/276773/2 "2021-06-30T07:45:50Z")

</div>

FYI a Stackoverflow user found a solution for the [question](https://stackoverflow.com/questions/68094162/elasticsseach-can-t-merge-a-non-object-mapping-with-an-object-mapping)

---

<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 28, 2021, 7:45am UTC](https://discuss.elastic.co/t/error-can-t-merge-a-non-object-mapping-with-an-object-mapping/276773/3 "2021-07-28T07:45:59Z")

</div>

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