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

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.

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:

"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" ?

FYI a Stackoverflow user found a solution for the question

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