[
https://issues.apache.org/jira/browse/LUCENE-6578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14600831#comment-14600831
]
Karl Wright commented on LUCENE-6578:
-------------------------------------
bq. For example I see the same method with method calls changed from
"normalDistance" to "normalDistanceSquared" but otherwise appears identical.
Can you please think of a way to approach this with less repetition and thus
more maintainability?
The whole purpose of having multiple distance metrics is performance. These
computations are expected to be used at document scoring time. Saving even a
single expensive sqrt is important in that context, which is why the
implementations look as they do.
Object creation for the purposes of reducing code "duplication according to
pattern" is also a bad idea for the same reason. Object creation would be
required for any kind of more complete code-sharing approach.
Mapping the xxx(GeoPoint pt) to xxx(x,y,z), though, is something doable and I
will look into it. I will also remove the javadoc, although I find it odd that
that would be considered important for Lucene.
> Geo3d: arcDistanceToShape() method may be useful
> ------------------------------------------------
>
> Key: LUCENE-6578
> URL: https://issues.apache.org/jira/browse/LUCENE-6578
> Project: Lucene - Core
> Issue Type: Bug
> Components: modules/spatial
> Reporter: Karl Wright
> Attachments: LUCENE-6578.patch
>
>
> I've got an application that seems like it may need the ability to compute a
> new kind of arc distance, from a GeoPoint to the nearest edge/point of a
> GeoShape. Adding this method to the interface, and corresponding
> implementations, would increase the utility of the package for ranking
> purposes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]