You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2016/02/03 16:23:39 UTC

[jira] [Closed] (SOLR-8636) Incorrect distance returned for indexed polygon shapes

     [ https://issues.apache.org/jira/browse/SOLR-8636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley closed SOLR-8636.
------------------------------
    Resolution: Won't Fix
      Assignee: David Smiley

Hello Rahul.  I will clarify this issue in the [reference guide|https://cwiki.apache.org/confluence/display/solr/Spatial+Search] right after I comment here.  Filtering and distance sorting are quite separate; they don't know about each other and for many cases, filtering doesn't even compute the distance any way, and so there's no lost optimization opportunity here either.

The score=distance (or other distance-like options) is intended for indexing either points in RPT, or boxes (rectangles) with BBoxField.  For that it works.  If you index non-point data in RPT, the results will be erroneous.  Presently there is no point-to-nonpoint shape (e.g. polygon or linestring) distance sorting.  FWIW there's the *opportunity* for that with come cool stuff in Lucene's Geo3D module but there's some work to get that into place.  I'm actually working on steps to enable Geo3D in Solr on the Spatial4j side right now, and then it'd be a separate issue to add Geo3D enabled distance sorting.

I decided to close this as it's a misunderstanding of the intention of what's there right now.  On the other hand, I think it would be a separate issue (feature not bug) mentioning Geo3D to implement what you're looking for.

> Incorrect distance returned for indexed polygon shapes
> ------------------------------------------------------
>
>                 Key: SOLR-8636
>                 URL: https://issues.apache.org/jira/browse/SOLR-8636
>             Project: Solr
>          Issue Type: Bug
>          Components: spatial
>    Affects Versions: 5.2.1
>            Reporter: Rahul Jain
>            Assignee: David Smiley
>
> 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?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org