Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-6446

Large spatial query problem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 4.9
    • None
    • spatial
    • None
    • Windows 7, Oracle JDK 1.7.0_45

    Description

      We are currently upgrading from Solr 4.1 to 4.9 and have observed differences in spatial query results.

      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"/>

      JTS v1.10 jar has been added to the classpath.

      A simple test case that shows the problem:
      I have 3 documents indexed each with one of the following polygon values set for the "geo" field.

      POLYGON ((-0.70312499989791 8.0592296260867, 13.359374998139 8.0592296260867, 13.359374998139 21.616579333871, -0.70312499989791 21.616579333871, -0.70312499989791 8.0592296260867))
      POLYGON ((120.58593748322 13.923403895824, 132.53906248155 13.923403895824, 132.53906248155 25.165173365383, 120.58593748322 25.165173365383, 120.58593748322 13.923403895824))
      POLYGON ((-133.24218748145 0.35156029394437, -121.99218748302 0.35156029394437, -121.99218748302 11.523087505283, -133.24218748145 11.523087505283, -133.24218748145 0.35156029394437))

      When I execute this query, I get only 2 results. With this exact same configuration and data in Solr 4.1, the query yields all 3 results.

      geo:"Intersects(POLYGON((-126 -14, 128 -14, 128 35, -126 35, -126 -14)))"

      My assumption is that the query now goes the opposite way around the earth. This seems to be confirmed by the following query that spans the date line. I get the same 2 results.

      geo:"Intersects(POLYGON((128 -14, 128 35, -126 35, -126 -14, 128 -14)))"

      Have I uncovered a bug or is this actually how the system is supposed to behave now? Is there a way to get the old behavior? It is a requirement for us to allow these large polygon queries.

      Attachments

        Activity

          People

            dsmiley David Smiley
            jhines Jon H
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: