lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4208) Spatial distance relevancy should use score of 1/distance
Date Fri, 14 Sep 2012 13:48:07 GMT


David Smiley commented on LUCENE-4208:

Here are my proposed updates to the javadocs:

   * Make a ValueSource returning the distance between the center of the
   * indexed shape and {@code queryPoint}.  If there are multiple indexed shapes
   * then the closest one is chosen.

   * Returns a ValueSource with values ranging from 1 to 0, depending inversely
   * to the distance from {@link #makeDistanceValueSource(com.spatial4j.core.shape.Point)}.
   * The formula is <code>c/(d + c)</code> where 'd' is the distance and 'c' is
   * one tenth the distance to the farthest edge from the center. Thus the
   * scores will be 1 for indexed points at the center of the query shape and as
   * low as ~0.1 at its furthest edges.
  public final ValueSource makeRecipDistanceValueSource(Shape queryShape) {
> Spatial distance relevancy should use score of 1/distance
> ---------------------------------------------------------
>                 Key: LUCENE-4208
>                 URL:
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: modules/spatial
>            Reporter: David Smiley
>             Fix For: 4.0
>         Attachments: LUCENE-4208_makeQuery_return_ConstantScoreQuery_and_remake_TwoDoublesStrategy.patch,
> The SpatialStrategy.makeQuery() at the moment uses the distance as the score (although
some strategies -- TwoDoubles if I recall might not do anything which would be a bug).  The
distance is a poor value to use as the score because the score should be related to relevancy,
and the distance itself is inversely related to that.  A score of 1/distance would be nice.
 Another alternative is earthCircumference/2 - distance, although I like 1/distance better.
 Maybe use a different constant than 1.
> Credit: this is Chris Male's idea.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message