# Insert geo\_point from spark in a new index

**URL:** <https://discuss.elastic.co/t/insert-geo-point-from-spark-in-a-new-index/67473>\
**Category:** Elasticsearch\
**Created:** [November 29, 2016, 11:09am UTC](https://discuss.elastic.co/t/insert-geo-point-from-spark-in-a-new-index/67473 "2016-11-29T11:09:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![beninv](https://avatars.discourse-cdn.com/v4/letter/b/b782af/32.png) [@beninv](https://discuss.elastic.co/u/beninv)\
**Post date:** [November 29, 2016, 11:09am UTC](https://discuss.elastic.co/t/insert-geo-point-from-spark-in-a-new-index/67473/1 "2016-11-29T11:09:09Z")

</div>

Hello,

I try to upload an RDD with a latitude and a longitude fields in my ES. I would like to use the geo\_point type to plot them on a map. I tried to create a "location" field for each document containing either a string like "12.25, -5.2" or a array of two doubles for lat/long but ES does not detect them as a geo\_point. The index does not exist before I insert data. so I add "es.index.auto.create" -\> "true" to my conf

How can I tell ES that location is a geo\_point without specify all the mapping?

Current code with the elasticsearch-hadoop lib to store:

myRDD.saveToEs(indexName, someConf)

with myRDD an RDD[Map] containing a "location" -\> [double, double]

and someConf contains "es.index.auto.create" -\> "true"

---

<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:** [December 27, 2016, 11:09am UTC](https://discuss.elastic.co/t/insert-geo-point-from-spark-in-a-new-index/67473/2 "2016-12-27T11:09:11Z")

</div>

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