# Location Mapping in Elasticsearch 7.6

**URL:** <https://discuss.elastic.co/t/location-mapping-in-elasticsearch-7-6/219537>\
**Category:** Elasticsearch\
**Created:** [February 16, 2020, 6:40pm UTC](https://discuss.elastic.co/t/location-mapping-in-elasticsearch-7-6/219537 "2020-02-16T18:40:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andre\_Bruederle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_bruederle/32/44720_2.png) [@Andre\_Bruederle](https://discuss.elastic.co/u/Andre_Bruederle)\
**Post date:** [February 16, 2020, 6:40pm UTC](https://discuss.elastic.co/t/location-mapping-in-elasticsearch-7-6/219537/1 "2020-02-16T18:40:32Z")

</div>

Hello,

I need help to get the location mapping for my dataset.  
I have the longitude and latitude and I tried to follow the official documentation about "geo-point datatype", but it doesn't work.

Here is the logstash file:

```
input {
	file {
		path => "C:/elastic_stack/new-york-city-airbnb-open-data/*.csv"
		start_position => "beginning"
		sincedb_path => "nul"
	}
}
filter {
	csv {
		separator => ","
		columns => ["id","name","host_id","host_name","neighbourhood_group","neighbourhood","latitude","longitude","room_type","price","minimum_nights","number_of_reviews","last_review","reviews_per_month","calculated_host_listings_count","availability_365"]
	}
	mutate { convert => {"latitude" => "float"} }
	mutate { convert => {"longitude" => "float"} }
	mutate { rename => {"latitude" => "[location][lat]"} }
	mutate { rename => {"longitude" => "[location][lon]"} }
}
output {
	elasticsearch {
		hosts => "http://localhost:9200"
		index => "nyc_test_2019"
		document_type => "nyc_test_2019"
	}
}

```

I have also put the mapping before uploading the data:

```
PUT nyc_test_2019
{
  "mappings": {
    "properties": {
      "location": {
        "type": "geo_point"
      }
    }
  }
}

```

But the data will not be uploaded if I define the geo\_point before.

WARN from Logstash:

[2020-02-16T19:37:17,578][WARN][logstash.outputs.elasticsearch][main] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"nyc\_test\_2019", :routing=\>nil, :\_type=\>"nyc\_test\_2019"}, #LogStash::Event:0x3d93f3af], :response=\>{"index"=\>{"\_index"=\>"nyc\_test\_2019", "\_type"=\>"nyc\_test\_2019", "\_id"=\>"QsRJT3AB8aRVYGwY8OQi", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"Rejecting mapping update to [nyc\_test\_2019] as the final mapping would have more than 1 type: [\_doc, nyc\_test\_2019]"}}}}  
[2020-02-16T19:37:17,641][WARN][logstash.filters.csv][main] Error parsing csv {:field=\>"message", :source=\>"3757461,"Manhattan Sun Drenched ", :exception=\>#\<CSV::MalformedCSVError: Unclosed quoted field on line 1.\>}  
[2020-02-16T19:37:17,647][WARN][logstash.filters.csv][main] Error parsing csv {:field=\>"message", :source=\>"Near Gramercy",17465563,Lola,Manhattan,Gramercy,40.73601,-73.98205,Private room,69,2,177,2019-06-22,2.98,1,285", :exception=\>#\<CSV::MalformedCSVError: Illegal quoting in line 1.\>}

WARN from Elasticsearch:

[2020-02-16T19:38:01,710][DEBUG][o.e.a.a.i.m.p.TransportPutMappingAction] [DESKTOP-192PII9] failed to put mappings on indices [[[nyc\_test\_2019/\_5fqjPKPRTOFDqEWDdEu7g]]], type [nyc\_test\_2019]  
java.lang.IllegalArgumentException: Rejecting mapping update to [nyc\_test\_2019] as the final mapping would have more than 1 type: [\_doc, nyc\_test\_2019]  
at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:272) ~[elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:238) ~[elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702) ~[elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324) ~[elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219) [elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.cluster.service.MasterService.access$000(MasterService.java:73) [elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.cluster.service.MasterService$Batcher.run(MasterService.java:151) [elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150) [elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188) [elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:703) [elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:252) [elasticsearch-7.5.2.jar:7.5.2]  
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:215) [elasticsearch-7.5.2.jar:7.5.2]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]  
at java.lang.Thread.run(Thread.java:830) [?:?]

I hope you can help me. I've been trying for more than a week now.

Best regards,  
André

---

<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:** [February 16, 2020, 9:55pm UTC](https://discuss.elastic.co/t/location-mapping-in-elasticsearch-7-6/219537/2 "2020-02-16T21:55:05Z")

</div>

Change

```
document_type => "nyc_test_2019"

```

With

```
document_type => "_doc"
```

---

<div class="post-metadata">

**Author:** ![Andre\_Bruederle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_bruederle/32/44720_2.png) [@Andre\_Bruederle](https://discuss.elastic.co/u/Andre_Bruederle)\
**Post date:** [February 17, 2020, 8:05am UTC](https://discuss.elastic.co/t/location-mapping-in-elasticsearch-7-6/219537/3 "2020-02-17T08:05:58Z")

</div>

Thank you very much!

I´t works perfect.

---

<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:** [March 16, 2020, 8:06am UTC](https://discuss.elastic.co/t/location-mapping-in-elasticsearch-7-6/219537/4 "2020-03-16T08:06:02Z")

</div>

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