Geo distance and bounding box

I am doing a geo_distance filter in my search (and I also have geo_distance
as one of my sorting fields).

I'm not sure how ES performs the geo_distance filtering under the hood but
I was wondering whether I should consider applying a bounding box
(geo_bbox) filter as well to my search to limit the number of records that
the geo_distance filter then needs to check individual distances for.

This way ES would be only be checking the distance of records that were
within the bounding box rather than all records that matched the search
term.

How does that sound?

--
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.

I'm not sure how ES performs the geo_distance filtering under the hood
but I was wondering whether I should consider applying a bounding box
(geo_bbox) filter as well to my search to limit the number of records
that the geo_distance filter then needs to check individual distances
for.

Have a look at the optimize_bbox parameter on the geo-distance filter
page:
http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter.html

clint

--
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 Clint,

thanks for pointing out to this option, looks like I've overseen it in the
past. I am not sure what the possible values (memory, indexed, ?) mean in
detail, can you share a line on this here? In the meantime I will throw
away my manual bounding box preprocessing ... :wink:

Thanks!
Andrej

Am Freitag, 8. Februar 2013 11:02:48 UTC+1 schrieb Clinton Gormley:

I'm not sure how ES performs the geo_distance filtering under the hood
but I was wondering whether I should consider applying a bounding box
(geo_bbox) filter as well to my search to limit the number of records
that the geo_distance filter then needs to check individual distances
for.

Have a look at the optimize_bbox parameter on the geo-distance filter
page:

http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter.html

clint

--
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.

On Fri, 2013-02-08 at 02:22 -0800, Andrej Rosenheinrich wrote:

Hi Clint,

thanks for pointing out to this option, looks like I've overseen it in
the past. I am not sure what the possible values (memory, indexed, ?)
mean in detail, can you share a line on this here? In the meantime I
will throw away my manual bounding box preprocessing ... :wink:

'memory' the default, just runs a geo_bbox check on each geo-point
loaded in memory.

'indexed' can only apply if you also set the lat/lon values to be
indexed separately (set lat_lon to true in your geo-point mapping)
http://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html

that way it can use a range filter to do the bbox check, which is
faster. (note that this option will only work for single geopoint values

  • it won't work if you have multiple geopoints per field)

clint

Thanks!
Andrej

Am Freitag, 8. Februar 2013 11:02:48 UTC+1 schrieb Clinton Gormley:

    > I'm not sure how ES performs the geo_distance filtering
    under the hood 
    > but I was wondering whether I should consider applying a
    bounding box 
    > (geo_bbox) filter as well to my search to limit the number
    of records 
    > that the geo_distance filter then needs to check individual
    distances 
    > for. 
    
    Have a look at the optimize_bbox parameter on the geo-distance
    filter 
    page: 
    http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter.html 
    
    clint 

--
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.

--
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.

Thanks for pointing that out Clint.

--
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.