# Different formats of geo\_point type

**URL:** <https://discuss.elastic.co/t/different-formats-of-geo-point-type/7667>\
**Category:** Elasticsearch\
**Created:** [May 12, 2012, 2:54am UTC](https://discuss.elastic.co/t/different-formats-of-geo-point-type/7667 "2012-05-12T02:54:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tule](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Tule](https://discuss.elastic.co/u/Tule)\
**Post date:** [May 12, 2012, 2:54am UTC](https://discuss.elastic.co/t/different-formats-of-geo-point-type/7667/1 "2012-05-12T02:54:35Z")

</div>

From the documentation here: [http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html](http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html)

It says geo\_point accept different format. Ex: these two are supported

1. "location" : "41.12,-71.34"
2. "location" : {  
"lat" : 41.12,  
"lon" : -71.34  
}

I want to ask if these two are the same?  
I'm using ES 0.17.6 and having this problem:  
When I index using the (1) format, I can't search with (2) format. If  
I use (1) again, it is successful.

How I index:  
curl -XPUT '[http://localhost:9200/twitter/pin/1](http://localhost:9200/twitter/pin/1)' -d '  
{  
"pin" : {  
"location" : {  
lat: 41.12,  
lon: -71.34  
},  
"tag" : ["food", "family"],  
"text" : "my favorite family restaurant"  
}  
}'

and how I search:  
curl -XGET '[http://localhost:9200/twitter/pin/\_search](http://localhost:9200/twitter/pin/_search)' -d '  
{  
"query": {  
"filtered" : {  
"query" : {  
"field" : { "text" : "restaurant" }  
},  
"filter" : {  
"geo\_distance" : {  
"distance" : "12km",  
"pin.location" : "-71.34, 41.12"  
}  
}  
}  
}  
}  
'

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [May 14, 2012, 1:17pm UTC](https://discuss.elastic.co/t/different-formats-of-geo-point-type/7667/2 "2012-05-14T13:17:11Z")

</div>

Answered on  
stackoverlflow [java - Different formats of geo\_point type? - Stack Overflow](http://stackoverflow.com/questions/10577251/different-formats-of-geo-point-type)

On Friday, May 11, 2012 10:54:35 PM UTC-4, Tule wrote:

> From the documentation here:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html)
> 
> It says geo\_point accept different format. Ex: these two are supported
> 
> 1. "location" : "41.12,-71.34"
> 2. "location" : {  
> "lat" : 41.12,  
> "lon" : -71.34  
> }
> 
> I want to ask if these two are the same?  
> I'm using ES 0.17.6 and having this problem:  
> When I index using the (1) format, I can't search with (2) format. If  
> I use (1) again, it is successful.
> 
> How I index:  
> curl -XPUT '[http://localhost:9200/twitter/pin/1](http://localhost:9200/twitter/pin/1)' -d '  
> {  
> "pin" : {  
> "location" : {  
> lat: 41.12,  
> lon: -71.34  
> },  
> "tag" : ["food", "family"],  
> "text" : "my favorite family restaurant"  
> }  
> }'
> 
> and how I search:  
> curl -XGET '[http://localhost:9200/twitter/pin/\_search](http://localhost:9200/twitter/pin/_search)' -d '  
> {  
> "query": {  
> "filtered" : {  
> "query" : {  
> "field" : { "text" : "restaurant" }  
> },  
> "filter" : {  
> "geo\_distance" : {  
> "distance" : "12km",  
> "pin.location" : "-71.34, 41.12"  
> }  
> }  
> }  
> }  
> }  
> '

---

<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, 3:28am UTC](https://discuss.elastic.co/t/different-formats-of-geo-point-type/7667/3 "2017-07-06T03:28:58Z")

</div>


