# Have a problem to map lat long field

**URL:** <https://discuss.elastic.co/t/have-a-problem-to-map-lat-long-field/21268>\
**Category:** Elasticsearch\
**Created:** [December 16, 2014, 6:47am UTC](https://discuss.elastic.co/t/have-a-problem-to-map-lat-long-field/21268 "2014-12-16T06:47:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anoop\_P\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anoop_p_r/32/1016_2.png) [@Anoop\_P\_R](https://discuss.elastic.co/u/Anoop_P_R)\
**Post date:** [December 16, 2014, 6:47am UTC](https://discuss.elastic.co/t/have-a-problem-to-map-lat-long-field/21268/1 "2014-12-16T06:47:54Z")

</div>

Hi, I have a problem with mapping latlong in elastic search

Here is my input data to elastic search server

{  
"member\_id": "8",  
"keywords": [  
"Sample 2",  
"Sample 3",  
"s",  
"sample"  
],  
"long\_descriptions": "Des",  
"general\_desc": "Sample",  
"service\_location": 1,  
"categories": [  
"Entertainment Entertainment Entertainment Entertai",  
"DJ’s",  
"Personal Driver",  
"Transportation Services"  
],

- "pin": {\*
- 

```
   "location": {*

```

- 

```
       "lat": 33.8101772,*

```

- 

```
       "lon": -118.3520389*

```

- 

```
   }*

```

- },\*  
"status": 1,  
"state": true  
}

and when I check the mapping it shows like

"member\_id": {  
"type": "string"  
},  
_"pin": {_

- 

```
                   "properties": {*

```

- 

```
                       "location": {*

```

- 

```
                           "properties": {*

```

- 

```
                               "lat": {*

```

- 

```
                                   "type": "double"*

```

- 

```
                               },*

```

- 

```
                               "lon": {*

```

- 

```
                                   "type": "double"*

```

- 

```
                               }*

```

- 

```
                           }*

```

- 

```
                       }*

```

- 

```
                   }*
              },

```

I am currently using elasticsearch v1.0.1, is this something related to the  
installation of elasticsearch?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/084dd688-b7c8-4d31-a0bc-1ad4ecdc0be3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/084dd688-b7c8-4d31-a0bc-1ad4ecdc0be3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [December 16, 2014, 7:25am UTC](https://discuss.elastic.co/t/have-a-problem-to-map-lat-long-field/21268/2 "2014-12-16T07:25:14Z")

</div>

There is no autodetection of geo\_point.  
So you need to provide first a mapping before sending the first document.

David

> Le 16 déc. 2014 à 07:47, Anoop P R [anoopkumaranalloor@gmail.com](mailto:anoopkumaranalloor@gmail.com) a écrit :
> 
> Hi, I have a problem with mapping latlong in Elasticsearch
> 
> Here is my input data to Elasticsearch server
> 
> {  
> "member\_id": "8",  
> "keywords": [  
> "Sample 2",  
> "Sample 3",  
> "s",  
> "sample"  
> ],  
> "long\_descriptions": "Des",  
> "general\_desc": "Sample",  
> "service\_location": 1,  
> "categories": [  
> "Entertainment Entertainment Entertainment Entertai",  
> "DJ’s",  
> "Personal Driver",  
> "Transportation Services"  
> ],  
> "pin": {  
> "location": {  
> "lat": 33.8101772,  
> "lon": -118.3520389  
> }  
> },  
> "status": 1,  
> "state": true  
> }
> 
> and when I check the mapping it shows like
> 
> "member\_id": {  
> "type": "string"  
> },  
> "pin": {  
> "properties": {  
> "location": {  
> "properties": {  
> "lat": {  
> "type": "double"  
> },  
> "lon": {  
> "type": "double"  
> }  
> }  
> }  
> }  
> },
> 
> ## I am currently using elasticsearch v1.0.1, is this something related to the installation of elasticsearch?
> 
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/084dd688-b7c8-4d31-a0bc-1ad4ecdc0be3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/084dd688-b7c8-4d31-a0bc-1ad4ecdc0be3%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/AF1B6386-3FA3-40A6-9C99-D0F92B733FD9%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/AF1B6386-3FA3-40A6-9C99-D0F92B733FD9%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anoop\_P\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anoop_p_r/32/1016_2.png) [@Anoop\_P\_R](https://discuss.elastic.co/u/Anoop_P_R)\
**Post date:** [December 16, 2014, 10:25am UTC](https://discuss.elastic.co/t/have-a-problem-to-map-lat-long-field/21268/3 "2014-12-16T10:25:17Z")

</div>

Thanks David, Now its works for me.

On Tuesday, December 16, 2014 12:55:45 PM UTC+5:30, David Pilato wrote:

> There is no autodetection of geo\_point.  
> So you need to provide first a mapping before sending the first document.
> 
> David
> 
> Le 16 déc. 2014 à 07:47, Anoop P R \<[anoopkuma...@gmail.com](mailto:anoopkuma...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Hi, I have a problem with mapping latlong in Elasticsearch
> 
> Here is my input data to Elasticsearch server
> 
> {  
> "member\_id": "8",  
> "keywords": [  
> "Sample 2",  
> "Sample 3",  
> "s",  
> "sample"  
> ],  
> "long\_descriptions": "Des",  
> "general\_desc": "Sample",  
> "service\_location": 1,  
> "categories": [  
> "Entertainment Entertainment Entertainment Entertai",  
> "DJ’s",  
> "Personal Driver",  
> "Transportation Services"  
> ],
> 
> - "pin": {\*
> - 
> 
> ```
> "location": {*
> 
> ```
> 
> - 
> 
> ```
> "lat": 33.8101772,*
> 
> ```
> 
> - 
> 
> ```
> "lon": -118.3520389*
> 
> ```
> 
> - 
> 
> ```
> }*
> 
> ```
> 
> - },\*  
> "status": 1,  
> "state": true  
> }
> 
> and when I check the mapping it shows like
> 
> "member\_id": {  
> "type": "string"  
> },  
> _"pin": {_
> 
> - 
> 
> ```
> "properties": {*
> 
> ```
> 
> - 
> 
> ```
> "location": {*
> 
> ```
> 
> - 
> 
> ```
> "properties": {*
> 
> ```
> 
> - 
> 
> ```
> "lat": {*
> 
> ```
> 
> - 
> 
> ```
> "type": "double"*
> 
> ```
> 
> - 
> 
> ```
> },*
> 
> ```
> 
> - 
> 
> ```
> "lon": {*
> 
> ```
> 
> - 
> 
> ```
> "type": "double"*
> 
> ```
> 
> - 
> 
> ```
> }*
> 
> ```
> 
> - 
> 
> ```
> }*
> 
> ```
> 
> - 
> 
> ```
> }*
> 
> ```
> 
> - 
> 
> ```
> }*
> },
> 
> ```
> 
> I am currently using elasticsearch v1.0.1, is this something related to  
> the installation of elasticsearch?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/084dd688-b7c8-4d31-a0bc-1ad4ecdc0be3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/084dd688-b7c8-4d31-a0bc-1ad4ecdc0be3%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/084dd688-b7c8-4d31-a0bc-1ad4ecdc0be3%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/084dd688-b7c8-4d31-a0bc-1ad4ecdc0be3%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2596df36-55a8-494b-be53-abdfc99d9a17%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2596df36-55a8-494b-be53-abdfc99d9a17%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:43am UTC](https://discuss.elastic.co/t/have-a-problem-to-map-lat-long-field/21268/4 "2017-07-06T00:43:30Z")

</div>

Closed on July 6, 2017, 12:43am UTC


