# Indexing + Quering GeoPoint documents

**URL:** <https://discuss.elastic.co/t/indexing-quering-geopoint-documents/19759>\
**Category:** Elasticsearch\
**Created:** [September 12, 2014, 3:08pm UTC](https://discuss.elastic.co/t/indexing-quering-geopoint-documents/19759 "2014-09-12T15:08:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashesh\_Ambasta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashesh_ambasta/32/1282_2.png) [@Ashesh\_Ambasta](https://discuss.elastic.co/u/Ashesh_Ambasta)\
**Post date:** [September 12, 2014, 3:08pm UTC](https://discuss.elastic.co/t/indexing-quering-geopoint-documents/19759/1 "2014-09-12T15:08:26Z")

</div>

This is more of a how-to question. I've created this mapping for  
"places/shops":

- places:  
{
  - mappings:  
{
    - shops:  
{
      - dynamic: "true",
      - numeric\_detection: true,
      - properties:  
{
        - available:  
{
          - type: "boolean"  
},

        - location:  
{
          - type: "geo\_point",
          - lat\_lon: true,
          - geohash: true  
}  
}  
}  
}  
}

Where I'm using location as the point I'd like to use for GeoDistance  
queries.

I'm then indexing a document that looks like;

{"available": true, location: [50, 50]}

I see that the document is indexed when doing a GET for places/shops/1 (I'm  
indexing the document at id = 1)

I'm then executing a query using elastic4s in scala which is again quite  
simple;  
val nearbyFuture:Future[SearchResponse] =  
client execute {  
search in "places" -\> "shops" filter {  
geoDistance("location") point(lat, lon) distance(kms)  
}  
}

In this case lat & lon are both 50.0, and kms = 50 as well. This is a  
really simple query and yet I end up with 0 hits.

Whats's going wrong here?

--  
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/b7b56190-5dca-4483-a4cb-63f57a709750%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b7b56190-5dca-4483-a4cb-63f57a709750%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, 1:02am UTC](https://discuss.elastic.co/t/indexing-quering-geopoint-documents/19759/2 "2017-07-06T01:02:45Z")

</div>


