# How to insert geo\_type in bulk insert?

**URL:** <https://discuss.elastic.co/t/how-to-insert-geo-type-in-bulk-insert/142385>\
**Category:** Elasticsearch\
**Created:** [July 31, 2018, 2:22pm UTC](https://discuss.elastic.co/t/how-to-insert-geo-type-in-bulk-insert/142385 "2018-07-31T14:22:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gosforth](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@Gosforth](https://discuss.elastic.co/u/Gosforth)\
**Post date:** [July 31, 2018, 2:22pm UTC](https://discuss.elastic.co/t/how-to-insert-geo-type-in-bulk-insert/142385/1 "2018-07-31T14:22:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 2, 2018, 11:10am UTC](https://discuss.elastic.co/t/how-to-insert-geo-type-in-bulk-insert/142385/2 "2018-08-02T11:10:09Z")

</div>

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](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

---

<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:** [August 30, 2018, 11:18am UTC](https://discuss.elastic.co/t/how-to-insert-geo-type-in-bulk-insert/142385/3 "2018-08-30T11:18:49Z")

</div>

Closed on August 30, 2018, 11:18am UTC

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