Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize_bbox for geo_distance filters can cause missing results #6008

Closed
jtibshirani opened this issue May 1, 2014 · 1 comment
Closed
Assignees
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes blocker >bug v1.1.2 v1.2.0 v2.0.0-beta1

Comments

@jtibshirani
Copy link
Contributor

When optimize_bbox is enabled for geo_distance filters, it can cause missing results:

https://gist.github.com/jtibshirani/1e42809a52be9ac651fc

This issue occurs on ES 1.1.1, and also in ES 1.0.3 and below, before the upgrade to Lucene 4.7. It seems the distance calculation for the bounding box uses DistanceUnit#getEarthRadius(), which is the radius at the semi-major axis, whereas the actual geo_distance filter uses SloppyMath to do the calculation. In Lucene 4.6 SloppyMath uses the average earth radius, and in 4.7 it averages the radii at the two points.

The same problem exists for both 'memory' and 'indexed' bounding boxes.

@jpountz jpountz self-assigned this May 5, 2014
@jpountz
Copy link
Contributor

jpountz commented May 6, 2014

Thanks for the detailed report, I could reproduce the issue and will work on a fix.

jpountz added a commit to jpountz/elasticsearch that referenced this issue May 6, 2014
We switched to Lucene's SloppyMath way of computing an approximate value of
the eath diameter given a latitude in order to compute distances, yet the
bounding box optimization of the geo distance filter still assumed a constant
earth diameter, equal to the average.

Close elastic#6008
jpountz added a commit that referenced this issue May 6, 2014
…timization.

We switched to Lucene's SloppyMath way of computing an approximate value of
the eath diameter given a latitude in order to compute distances, yet the
bounding box optimization of the geo distance filter still assumed a constant
earth diameter, equal to the average.

Close #6008
@jpountz jpountz closed this as completed in c306d8c May 6, 2014
jpountz added a commit that referenced this issue May 6, 2014
…timization.

We switched to Lucene's SloppyMath way of computing an approximate value of
the eath diameter given a latitude in order to compute distances, yet the
bounding box optimization of the geo distance filter still assumed a constant
earth diameter, equal to the average.

Close #6008
@jpountz jpountz added the v1.1.2 label May 6, 2014
@clintongormley clintongormley changed the title optimize_bbox for geo_distance filters can cause missing results optimize_bbox for geo_distance filters can cause missing results Jun 7, 2015
@clintongormley clintongormley added the :Analytics/Geo Indexing, search aggregations of geo points and shapes label Jun 7, 2015
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
…timization.

We switched to Lucene's SloppyMath way of computing an approximate value of
the eath diameter given a latitude in order to compute distances, yet the
bounding box optimization of the geo distance filter still assumed a constant
earth diameter, equal to the average.

Close elastic#6008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes blocker >bug v1.1.2 v1.2.0 v2.0.0-beta1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants