# Enabling geohash indexing on Geo Point type

**URL:** <https://discuss.elastic.co/t/enabling-geohash-indexing-on-geo-point-type/11034>\
**Category:** Elasticsearch\
**Created:** [March 6, 2013, 2:55pm UTC](https://discuss.elastic.co/t/enabling-geohash-indexing-on-geo-point-type/11034 "2013-03-06T14:55:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gian\_Luca\_Ortelli](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@Gian\_Luca\_Ortelli](https://discuss.elastic.co/u/Gian_Luca_Ortelli)\
**Post date:** [March 6, 2013, 2:55pm UTC](https://discuss.elastic.co/t/enabling-geohash-indexing-on-geo-point-type/11034/1 "2013-03-06T14:55:59Z")

</div>

Hi,

I have defined the mapping below on my index:

{  
"poi" : {  
"properties" : {  
"location" : {  
"type" : "geo\_point",  
"geohash" : true  
},  
...  
}  
}  
}

I'm now trying to make a query where I search by geohash, but I can't  
figure out which field to reference. Also, what kind of queries am I  
allowed to do on the geohash?

Thanks,  
Gianluca

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 6, 2013, 6:29pm UTC](https://discuss.elastic.co/t/enabling-geohash-indexing-on-geo-point-type/11034/2 "2013-03-06T18:29:18Z")

</div>

The field you'd search is "location" and the docs on the geo shape filter  
are here:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Although, beware - the docs should be updated soon. "within" and "disjoint"  
are no longer supported as their implementation was buggy

clint

On Wed, Mar 6, 2013 at 3:55 PM, Gian Luca Ortelli \<  
gianluca.ortelli@trifork.nl\> wrote:

> Hi,
> 
> I have defined the mapping below on my index:
> 
> {  
> "poi" : {  
> "properties" : {  
> "location" : {  
> "type" : "geo\_point",  
> "geohash" : true  
> },  
> ...  
> }  
> }  
> }
> 
> I'm now trying to make a query where I search by geohash, but I can't  
> figure out which field to reference. Also, what kind of queries am I  
> allowed to do on the geohash?
> 
> Thanks,  
> Gianluca
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Gian\_Luca\_Ortelli](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@Gian\_Luca\_Ortelli](https://discuss.elastic.co/u/Gian_Luca_Ortelli)\
**Post date:** [March 8, 2013, 9:58am UTC](https://discuss.elastic.co/t/enabling-geohash-indexing-on-geo-point-type/11034/3 "2013-03-08T09:58:03Z")

</div>

Hi,

the closest example that I found in the docs is below:

{  
"filtered": {  
"query": {  
"match\_all": {}  
},  
"filter": {  
"geo\_shape": {  
"location": {  
"shape": {  
"type": "envelope",  
"coordinates":[[-45,45],[45,-45]]  
},  
"relation": "within"  
}  
}  
}  
}  
}

What I have available client side is a geohash value, describing the cell I  
want to search in. I might translate that to a pair of coordinates, but is  
there a way to give the value directly in the filter?

Thanks,  
Gianluca

On Wednesday, March 6, 2013 7:29:18 PM UTC+1, Clinton Gormley wrote:

> The field you'd search is "location" and the docs on the geo shape filter  
> are here:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/geo-shape-filter.html)
> 
> Although, beware - the docs should be updated soon. "within" and  
> "disjoint" are no longer supported as their implementation was buggy
> 
> clint
> 
> On Wed, Mar 6, 2013 at 3:55 PM, Gian Luca Ortelli \<gianluca...@trifork.nl\<javascript:\>
> 
> > wrote:
> 
> > Hi,
> > 
> > I have defined the mapping below on my index:
> > 
> > {  
> > "poi" : {  
> > "properties" : {  
> > "location" : {  
> > "type" : "geo\_point",  
> > "geohash" : true  
> > },  
> > ...  
> > }  
> > }  
> > }
> > 
> > I'm now trying to make a query where I search by geohash, but I can't  
> > figure out which field to reference. Also, what kind of queries am I  
> > allowed to do on the geohash?
> > 
> > Thanks,  
> > Gianluca
> > 
> > --  
> > 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:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 8, 2013, 12:50pm UTC](https://discuss.elastic.co/t/enabling-geohash-indexing-on-geo-point-type/11034/4 "2013-03-08T12:50:48Z")

</div>

I don't think you can combine geohashes with geo-shapes, at least not yet.

Perhaps open an issue requesting it?

Clint

On Fri, Mar 8, 2013 at 10:58 AM, Gian Luca Ortelli \<  
gianluca.ortelli@trifork.nl\> wrote:

> Hi,
> 
> the closest example that I found in the docs is below:
> 
> {  
> "filtered": {  
> "query": {  
> "match\_all": {}  
> },  
> "filter": {  
> "geo\_shape": {  
> "location": {  
> "shape": {  
> "type": "envelope",  
> "coordinates":[[-45,45],[45,-45]]  
> },  
> "relation": "within"  
> }  
> }  
> }  
> }  
> }
> 
> What I have available client side is a geohash value, describing the cell  
> I want to search in. I might translate that to a pair of coordinates, but  
> is there a way to give the value directly in the filter?
> 
> Thanks,  
> Gianluca
> 
> On Wednesday, March 6, 2013 7:29:18 PM UTC+1, Clinton Gormley wrote:
> 
> > The field you'd search is "location" and the docs on the geo shape filter  
> > are here: [http://www](http://www).**[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://elasticsearch.org/guide/)**  
> > reference/query-dsl/geo-shape-\*\*filter.html[http://www.elasticsearch.org/guide/reference/query-dsl/geo-shape-filter.html](http://www.elasticsearch.org/guide/reference/query-dsl/geo-shape-filter.html)
> > 
> > Although, beware - the docs should be updated soon. "within" and  
> > "disjoint" are no longer supported as their implementation was buggy
> > 
> > clint
> > 
> > On Wed, Mar 6, 2013 at 3:55 PM, Gian Luca Ortelli \<gianluca...@trifork.nl
> > 
> > > wrote:
> > 
> > > Hi,
> > > 
> > > I have defined the mapping below on my index:
> > > 
> > > {  
> > > "poi" : {  
> > > "properties" : {  
> > > "location" : {  
> > > "type" : "geo\_point",  
> > > "geohash" : true  
> > > },  
> > > ...  
> > > }  
> > > }  
> > > }
> > > 
> > > I'm now trying to make a query where I search by geohash, but I can't  
> > > figure out which field to reference. Also, what kind of queries am I  
> > > allowed to do on the geohash?
> > > 
> > > Thanks,  
> > > Gianluca
> > > 
> > > --  
> > > 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](http://googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > .
> > 
> > --  
> > 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).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:47am UTC](https://discuss.elastic.co/t/enabling-geohash-indexing-on-geo-point-type/11034/5 "2017-07-06T02:47:35Z")

</div>


