Details
Description
We are currently upgrading from Solr 4.1 to 4.9 and have observed some odd behavior with multipolygon queries now. It is difficult to describe what is happening so I took a screenshot with the documents and query area plotted on a map. You can see it here: http://imgur.com/iBpYLMh The blue areas represent the multipolygon and the purple areas represent the document footprints.
The query being used is as follows:
geo:"Intersects(MULTIPOLYGON(((-3 2,4 2,4 8,-3 8,-3 2)),((-3 -11,4 -11,4 -4,-3 -4,-3 -11))))"
This query returns all results when it should be returning only 8. If I run two separate queries with each individual polygon, I get 4 hits each as expected.
I've narrowed this down to a problem with using 'datelineRule=ccwRect'. If I remove this setting, the query returns with the expected results. Unfortunately, this setting is required for our software though, since handling large polygon queries (spanning >180 degrees) are a requirement.
Here are the relevant schema details:
<field name="geo" type="location_rpt" indexed="true" stored="false"/>
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType" spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
geo="true" distErrPct="0.1" maxDistErr="0.000009" units="degrees"
datelineRule="ccwRect" normWrapLongitude="true" autoIndex="true"/>