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

Incorrect distance returned for indexed polygon shapes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 5.2.1
    • None
    • spatial
    • None

    Description

      We have a location_rpt field with multivalued=true and we are indexing multiple shapes of type LINESTRING() in a single spatial field per document. We are using JTS for spatial and polygon indexing and filtering.

      Solr query:
      q=

      {!geofilt sfield=geo pt=-27,153 score=distance d=50}

      &fl=*,score

      For above query, we get the results perfectly fine (i.e. documents with at least one intersecting shape is returned) but the returned distance has following behavior:
      1. When only shapes (LINESTRING(), LINESTRING()) are indexed then the distance returned is 180 degrees or 20015.115 kms.
      2. When only points are indexed then the distance to nearest point is returned.
      3. When both points and shapes are indexed, distance to nearest point is returned.

      Using above distance in sorting causes sorting to go haywire.

      Does Solr not return the distance it used during document filtering? Is there a workaround or am I doing something wrong?

      Attachments

        Activity

          People

            dsmiley David Smiley
            rahulj_ Rahul Jain
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: