How to insert geo_type in bulk insert?

I'd like to insert geo coordinates for Region Map and Coordinate Map. How the Json line should look like (bulk insert).
I have below example but type is recognized as float

{ "index" : { "_index" : "sale", "_type" : "doc", "_id" : "1" }}
{"product_id": 1860441,"location": {"lat" : 33.5206608, "long" : 67.8024900}}
{ "index" : { "_index" : "sale", "_type" : "doc", "_id" : "2" }}
{"product_id": 1860441,"location": {"lat" : 33.5206608, "long" : 12.8024900}}

Possible to define field type in Json file?

Regards

Hey,

two things here: First, ensure that your location field is from mapping type geo_point, see https://www.elastic.co/guide/en/elasticsearch/reference/6.3/geo-point.html. Second, the location field should include lat and lon fields (without the g).

Hope this helps!

--Alex

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