Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5118

spatial strategy- add multiplier to makeDistanceValueSource()

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.5, 6.0
    • modules/spatial
    • None
    • New

    Description

      SpatialStrategy has this abstract method:

      /**
         * 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.
         */
        public abstract ValueSource makeDistanceValueSource(Point queryPoint);
      

      I'd like to add another argument double multiplier that is internally multiplied to the result per document. It's a convenience over having the user wrap this with another ValueSource, and it'd be faster too. Typical usage would be to add a degrees-to-kilometers multiplier.

      The current method could be marked deprecated with a default implementation that invokes the new one with a 1.0 multiplier.

      Attachments

        Issue Links

          Activity

            People

              dsmiley David Smiley
              dsmiley David Smiley
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: