# Distance is not working

**URL:** <https://discuss.elastic.co/t/distance-is-not-working/4802>\
**Category:** Elasticsearch\
**Created:** [July 7, 2011, 4:50am UTC](https://discuss.elastic.co/t/distance-is-not-working/4802 "2011-07-07T04:50:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nachiket](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nachiket](https://discuss.elastic.co/u/nachiket)\
**Post date:** [July 7, 2011, 4:50am UTC](https://discuss.elastic.co/t/distance-is-not-working/4802/1 "2011-07-07T04:50:04Z")

</div>

Hi.  
I want to write a script which sorts on the basis of geographical  
distance.  
For some unknown reason it is not working.  
Can somebody have a look at it?  
The code is at git://gist.github.com/1068903.git

Regards.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 7, 2011, 2:35pm UTC](https://discuss.elastic.co/t/distance-is-not-working/4802/2 "2011-07-07T14:35:51Z")

</div>

can you try and do doc['location']. (note, this can get tricky with curl).

On Thursday, July 7, 2011 at 7:50 AM, nachiket bhagwat wrote:

> Hi.  
> I want to write a script which sorts on the basis of geographical  
> distance.  
> For some unknown reason it is not working.  
> Can somebody have a look at it?  
> The code is at git://gist.github.com/1068903.git ([Distance not working · GitHub](http://gist.github.com/1068903.git))
> 
> Regards.

---

<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, 4:01am UTC](https://discuss.elastic.co/t/distance-is-not-working/4802/3 "2017-07-06T04:01:25Z")

</div>

Closed on July 6, 2017, 4:01am UTC


