Geohash_cell filter

Hi,

I tried to use geohash_cell filter, as its an interesting functionality. My
mapping for the geopoint looks like:

LOCATION: {
lat_lon: true
geohash_prefix: true
type: geo_point
geohash: true
}

Testing with the example query from the docs site works for me:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"LOCATION": {
"lat": 13.408,
"lon": 52.5186
},
"precision": 3,
"neighbors": true
}
}
}
}
}

So I think mapping and indexing is right. Then I wanted to filter not by
point and precision but directly by geohash (as found in the issue 3218),
but this aint working

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"field": "LOCATION",
"geohash": "u30"
}
}
}
}
}

Can someone point me to what I am doing wrong or how to filter directly by
geohash?

Thanks,
Andrej

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Andrej,

so far your setup look good, Do you have any clue of what's not working?
Which version are you using? Do you get any error messages?

cheers,
Florian

On Tuesday, July 9, 2013 5:48:34 PM UTC+2, Andrej Rosenheinrich wrote:

Hi,

I tried to use geohash_cell filter, as its an interesting functionality.
My mapping for the geopoint looks like:

LOCATION: {
lat_lon: true
geohash_prefix: true
type: geo_point
geohash: true
}

Testing with the example query from the docs site works for me:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"LOCATION": {
"lat": 13.408,
"lon": 52.5186
},
"precision": 3,
"neighbors": true
}
}
}
}
}

So I think mapping and indexing is right. Then I wanted to filter not by
point and precision but directly by geohash (as found in the issue 3218),
but this aint working

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"field": "LOCATION",
"geohash": "u30"
}
}
}
}
}

Can someone point me to what I am doing wrong or how to filter directly by
geohash?

Thanks,
Andrej

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Andrej,

I just recognized the mistake. try:

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"LOCATION": "u30"
}
}
}
}
}

cheers,
Florian

On Wednesday, July 10, 2013 9:51:18 AM UTC+2, Florian Schilling wrote:

Hi Andrej,

so far your setup look good, Do you have any clue of what's not working?
Which version are you using? Do you get any error messages?

cheers,
Florian

On Tuesday, July 9, 2013 5:48:34 PM UTC+2, Andrej Rosenheinrich wrote:

Hi,

I tried to use geohash_cell filter, as its an interesting functionality.
My mapping for the geopoint looks like:

LOCATION: {
lat_lon: true
geohash_prefix: true
type: geo_point
geohash: true
}

Testing with the example query from the docs site works for me:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"LOCATION": {
"lat": 13.408,
"lon": 52.5186
},
"precision": 3,
"neighbors": true
}
}
}
}
}

So I think mapping and indexing is right. Then I wanted to filter not by
point and precision but directly by geohash (as found in the issue 3218),
but this aint working

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"field": "LOCATION",
"geohash": "u30"
}
}
}
}
}

Can someone point me to what I am doing wrong or how to filter directly
by geohash?

Thanks,
Andrej

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Florian,

thanks a lot, that works! May be it would be helpful to add this version of
the filter to the geohash_cell filter docu?

Cheers,
Andrej

Am Mittwoch, 10. Juli 2013 10:21:05 UTC+2 schrieb Florian Schilling:

Hi Andrej,

I just recognized the mistake. try:

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"LOCATION": "u30"
}
}
}
}
}

cheers,
Florian

On Wednesday, July 10, 2013 9:51:18 AM UTC+2, Florian Schilling wrote:

Hi Andrej,

so far your setup look good, Do you have any clue of what's not working?
Which version are you using? Do you get any error messages?

cheers,
Florian

On Tuesday, July 9, 2013 5:48:34 PM UTC+2, Andrej Rosenheinrich wrote:

Hi,

I tried to use geohash_cell filter, as its an interesting functionality.
My mapping for the geopoint looks like:

LOCATION: {
lat_lon: true
geohash_prefix: true
type: geo_point
geohash: true
}

Testing with the example query from the docs site works for me:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"LOCATION": {
"lat": 13.408,
"lon": 52.5186
},
"precision": 3,
"neighbors": true
}
}
}
}
}

So I think mapping and indexing is right. Then I wanted to filter not by
point and precision but directly by geohash (as found in the issue 3218),
but this aint working

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"field": "LOCATION",
"geohash": "u30"
}
}
}
}
}

Can someone point me to what I am doing wrong or how to filter directly
by geohash?

Thanks,
Andrej

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Andrej,

you're right. The format has been updated recently to match the other
filter formats.
See Geohash filter format · Issue #3229 · elastic/elasticsearch · GitHub. This format
is described
on Elasticsearch Platform — Find real-time answers at scale | Elastic.

cheers,
Florian

On Wednesday, July 10, 2013 11:48:01 AM UTC+2, Andrej Rosenheinrich wrote:

Hi Florian,

thanks a lot, that works! May be it would be helpful to add this version
of the filter to the geohash_cell filter docu?

Cheers,
Andrej

Am Mittwoch, 10. Juli 2013 10:21:05 UTC+2 schrieb Florian Schilling:

Hi Andrej,

I just recognized the mistake. try:

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"LOCATION": "u30"
}
}
}
}
}

cheers,
Florian

On Wednesday, July 10, 2013 9:51:18 AM UTC+2, Florian Schilling wrote:

Hi Andrej,

so far your setup look good, Do you have any clue of what's not working?
Which version are you using? Do you get any error messages?

cheers,
Florian

On Tuesday, July 9, 2013 5:48:34 PM UTC+2, Andrej Rosenheinrich wrote:

Hi,

I tried to use geohash_cell filter, as its an interesting
functionality. My mapping for the geopoint looks like:

LOCATION: {
lat_lon: true
geohash_prefix: true
type: geo_point
geohash: true
}

Testing with the example query from the docs site works for me:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"LOCATION": {
"lat": 13.408,
"lon": 52.5186
},
"precision": 3,
"neighbors": true
}
}
}
}
}

So I think mapping and indexing is right. Then I wanted to filter not
by point and precision but directly by geohash (as found in the issue
3218), but this aint working

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geohash_cell": {
"field": "LOCATION",
"geohash": "u30"
}
}
}
}
}

Can someone point me to what I am doing wrong or how to filter directly
by geohash?

Thanks,
Andrej

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Florian,

may I ask if bounding box filter is benefitting from indexed geohashes?
Looking over the code (havent understood it completely, honestly) it doesnt
seem so? Would it make sense to try to emulate bounding box as a boolfilter
of geohash_cell filter? Or would you consider bounding box implementation
as reasonable fast?

What I actually want to do is to get the best results within an area. So my
idea is running a match_all query and a bounding box filter to select
documents within that area (assuming that bounding box is fast) and rescore
with the query that calculates scores and returns the best results. Would
you think this approach makes sense?

Thanks for your help!
Andrej

PS: Will you attend ElasticSearch User Group Meeting in Berlin this month?
May be we could discuss this face to face :wink:

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hey Andrej,

the boundingbox filter and the geohash_cell filter are two completely
different filters. Filter by boundingboxes is the more intuitive approach,
since you are able to define your own ranges and positions. The
geohash_cell filter in turn, works on a pre-defined grid with fixed sizes
of boxes.
So filtering boundingboxes is similar to (at least) two range filter. One
for latitude and one for the longitude. The last one can be extended to a
third one if the filter crosses the dateline. Geohash filters work in a
different way: Since all prefixes of the geohash related to a document are
stored this filter is similar to singe term lookup (or a terms look if
neighbors is enabled). This makes the geohash_cell filters very fast with
the limitation to the fixed grid.
I think in your case the boundingbox filter will work fine. Another case I
could think of is a geo_distance filter. This one is not very fast. So the
geohash filter can be used as a pre-filter which roughly selects all
documents within your area and then apply the geo_distance filter to this
reduced resultset. This can be done in a single call. Also this filter
might be interesting for faceting...
I think there are a lot of applications for this and I'll try to join the
usergroup at the end of the month.

Cheers,
Florian

On Thursday, July 11, 2013 10:45:39 AM UTC+2, Andrej Rosenheinrich wrote:

Florian,

may I ask if bounding box filter is benefitting from indexed geohashes?
Looking over the code (havent understood it completely, honestly) it doesnt
seem so? Would it make sense to try to emulate bounding box as a boolfilter
of geohash_cell filter? Or would you consider bounding box implementation
as reasonable fast?

What I actually want to do is to get the best results within an area. So
my idea is running a match_all query and a bounding box filter to select
documents within that area (assuming that bounding box is fast) and rescore
with the query that calculates scores and returns the best results. Would
you think this approach makes sense?

Thanks for your help!
Andrej

PS: Will you attend Elasticsearch User Group Meeting in Berlin this month?
May be we could discuss this face to face :wink:

--
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.
For more options, visit https://groups.google.com/groups/opt_out.