Issue 12571

bbox search matches wrong occurrence records

12571
Reporter: mdoering
Assignee: fmendez
Type: Bug
Summary: bbox search matches wrong occurrence records
Priority: Critical
Resolution: Fixed
Status: Closed
Created: 2012-12-21 13:27:26.95
Updated: 2013-12-17 15:16:41.856
Resolved: 2013-01-29 17:06:05.442
        
Description: Only georeferenced records within the box should be returned, but we also get zero/zero records and records without a geolocation:
http://staging.gbif.org:8080/occurrence-ws/occurrence/search?BOUNDING_BOX=-9.795%2C39.375%2C-29.535%2C52.734

for example the above search includes these in the first page:
http://localhost:8080/occurrence/35055632
http://localhost:8080/occurrence/35055633
http://localhost:8080/occurrence/35055629]]>
    

Attachment Screen Shot 2013-01-08 at 6.56.26 PM.png



Author: kbraak@gbif.org
Comment: +1 for getting this fixed. The following search for a single record by catalog number (known not to have a geolocation) with bounding box over the United States ( http://api.gbif.org/dev/occurrence/32838766 ) should return no results: http://staging.gbif.org:8080/portal-web-dynamic/occurrence/search?BOUNDING_BOX=52.052%2C-131.484%2C7.710%2C-49.218&CATALOG_NUMBER=PAPS5-56000
Created: 2013-01-08 19:01:10.951
Updated: 2013-01-08 19:01:10.951


Author: mdoering@gbif.org
Created: 2013-01-10 12:07:50.737
Updated: 2013-01-10 12:07:50.737
        
Please also test bbox queries across the dateline.
For example the eastern russian province Chukotskiy Avtonomnyy Okrug according to Flickr: http://www.flickr.com/places/info/20070513

# bbox=bottom,left,top,right
61.8010,157.6339,71.6121,-169.0023
    


Author: fmendez@gbif.org
Created: 2013-01-11 16:59:06.431
Updated: 2013-01-11 16:59:06.431
        
The shown results are incorrect in some cases because the solr registry and hbase are out of sync; for example:
http://staging.gbif.org:8080/occurrence-ws/occurrence/32838766 doesn't contain any lat/lon value
but
http://boma.gbif.org:8080/occurrence-solr/select?q=key:32838766%20AND%20coordinate_0_coord:41.649318 matches agains latitude=41.649318
    


Author: fmendez@gbif.org
Created: 2013-01-11 17:03:03.239
Updated: 2013-01-11 17:03:03.239
        
Seems that Solr does not support bboxes around meridian coordinates: https://issues.apache.org/jira/browse/SOLR-2609

    


Author: mdoering@gbif.org
Comment: Too bad. Can we translate those special cases into 2 OR bbox queries, one on the west and one of the east side of the anti meridian?
Created: 2013-01-11 17:14:37.886
Updated: 2013-01-11 17:14:37.886


Author: fmendez@gbif.org
Comment: don't know how to do that Markus, do you have any idea?
Created: 2013-01-14 08:54:22.596
Updated: 2013-01-14 08:54:22.596


Author: fmendez@gbif.org
Created: 2013-01-14 09:29:25.646
Updated: 2013-01-14 14:51:36.992
        
After reading several blogs and Solr issues; i have decided that is better try to integrate the new Lucene/Solr spatial plugin instead of using the default geospatial component; the main benefits of that module are:
- multi-value location fields, the default Solr compoent doesn't suppor multivalue field which is not an issue for the occurrence index but could be very helpful for the dataset-registry index.
- polygon search
- supports searches around the prime meridians
- performance: "..was benchmarked once showing it outperforms Solr 3's "LatLonType" at its own game...Solr 3 LatLonType sometimes requires all the points to be in memory, whereas the new spatial module here doesn't for filtering..."
- there are other features that the plugin has that are not 100% relevant for us.

http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
    


Author: mdoering@gbif.org
Comment: Can we create a new issue for using this new solr plugin and close this one if the original bbox issue is solved?
Created: 2013-01-14 15:20:25.169
Updated: 2013-01-14 15:20:25.169


Author: fmendez@gbif.org
Comment: no yet, i found an error in the occurrence indexer that is related to this issue and 'm working on that
Created: 2013-01-14 15:30:10.869
Updated: 2013-01-14 15:30:10.869


Author: mdoering@gbif.org
Comment: The bbox search is not working at all on staging right now - the filter gets removed on every search
Created: 2013-01-26 15:18:46.594
Updated: 2013-01-26 15:18:46.594


Author: fmendez@gbif.org
Comment: http://code.google.com/p/gbif-portal/source/detail?r=1333
Created: 2013-01-29 17:06:05.495
Updated: 2013-01-29 17:06:05.495