Insert geo_point from spark in a new index

(Benjamin) #1


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

(system) #2

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