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

geodist returns polygon with incorrect distance

    XMLWordPrintableJSON

Details

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

    Description

      I have an RPT field which contains a mix of points and polygons.

      When I perform a geodist query, where the query point is within an indexed polygon, the polygon is correctly returned, however it is sorted as being the most distant, and the returned distance to the polygon exceeds the maximum distance specified in the query.

      Obviously some calculation is being performed which puts the polygon within 100m of the query point, however the distance being calculated for sorting or/and response is not the same. It appears from playing with the query that if the Polygon is within the query distance then it is always returned as the last document, whether or not the documents are sorted.

       

       

      This is the query and the final two documents returned...

       

      http://localhost:8983/solr/Naptan/select?q=*:*&fl=*,dist:geodist()&rows=100&fq=\{!geofilt}&sfield=location&pt=53.3805565,-1.4645408&d=0.1&sort=geodist()%20asc

      ...

      35  
      ATCOCode "370022835"
      StopType "BCT"
      StopCategory "Bus"
      location  
      0 "53.3813701862,-1.4650627934"
      version 1614979438316880000
      dist 0.096849374
      36  
      ATCOCode "502432214"
      StopType "BCS"
      StopCategory "Bus"
      location  
      0 "POLYGON ((-1.4646256 53.3796518, -1.4635259 53.3796806, -1.4636171 53.3805894, -1.4627105 53.3810406, -1.4647973 53.3811781, -1.4646256 53.3796518))"
      version 1615121382652248000
      dist 20015.115

      Attachments

        Activity

          People

            Unassigned Unassigned
            neilireson Neil Ireson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: