[ 
https://issues.apache.org/jira/browse/SOLR-6797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14251205#comment-14251205
 ] 

David Smiley commented on SOLR-6797:
------------------------------------

Thanks for supplying a patch!

* if score=miles|kilometers then I think we can quite explicitly do that 
without checking ctx.isGeo.  This is what the user asked for, so they know what 
they are doing.
* if score=distance, we should have backwards-compatible behavior.  If you set 
units="degrees" on the field type then that's what you get here.  I'm unsure if 
we should otherwise throw an exception, or otherwise let you set units to 
miles|kilomters or otherwise always choose a default based on ctx.isGeo (km or 
degrees).  My preference is the latter, and we should discourage score=distance 
generally as it's unclear.  But just a preference; I think you've expressed an 
opinion for the 2nd and that's fine with me too.
* We should allow "units" to be unset (preferred actually). This is my 1st 
bullet in the description.
* in ShapeAreaValueSource, you can pull the computed multiplier of the function 
so that it's not called each time: {{(geoArea ? DistanceUtils.DEG_TO_KM * 
DistanceUtils.DEG_TO_KM: 1.0)}}

Tests please?

> Add score=degrees|kilometers|miles for AbstractSpatialFieldType
> ---------------------------------------------------------------
>
>                 Key: SOLR-6797
>                 URL: https://issues.apache.org/jira/browse/SOLR-6797
>             Project: Solr
>          Issue Type: Improvement
>          Components: spatial
>            Reporter: David Smiley
>         Attachments: SOLR-6797.patch
>
>
> Annoyingly, the units="degrees" attribute is required for fields extending 
> AbstractSpatialFieldType (e.g. RPT, BBox).  And it doesn't really have any 
> effect.  I propose the following:
> * Simply drop the attribute; ignore it if someone sets it to "degrees" (for 
> back-compat).
> * When using score="distance", or score=area or area2D (as seen in BBoxField) 
> then use kilometers if geo=true, otherwise degrees.
> * Add support for score=degrees|kilometers|miles|degrees



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to