Lucene - Core
  1. Lucene - Core
  2. LUCENE-5118

spatial strategy- add multiplier to makeDistanceValueSource()

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5, Trunk
    • Component/s: modules/spatial
    • Labels:
      None
    • Lucene Fields:
      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.

        Issue Links

          Activity

          Hide
          David Smiley added a comment -

          This doesn't strictly block SOLR-2345 but it makes implementing that one easier.

          I should have a patch today.

          Show
          David Smiley added a comment - This doesn't strictly block SOLR-2345 but it makes implementing that one easier. I should have a patch today.
          Hide
          David Smiley added a comment -

          See attached patch. A minor ancillary thing I did was add equals & hashCode to BBox's AreaSimilarity which is important for cacheability of the ValueSource that contains it.

          I had second thoughts on deprecating the method without the multiplier so I didn't do that.

          What do you think Ryan McKinley?

          Show
          David Smiley added a comment - See attached patch. A minor ancillary thing I did was add equals & hashCode to BBox's AreaSimilarity which is important for cacheability of the ValueSource that contains it. I had second thoughts on deprecating the method without the multiplier so I didn't do that. What do you think Ryan McKinley ?
          Hide
          Ryan McKinley added a comment -

          seems fine to me

          Show
          Ryan McKinley added a comment - seems fine to me
          Hide
          ASF subversion and git services added a comment -

          Commit 1506632 from David Smiley in branch 'dev/trunk'
          [ https://svn.apache.org/r1506632 ]

          LUCENE-5118: multiplier to spatial makeDistanceValueSource

          Show
          ASF subversion and git services added a comment - Commit 1506632 from David Smiley in branch 'dev/trunk' [ https://svn.apache.org/r1506632 ] LUCENE-5118 : multiplier to spatial makeDistanceValueSource
          Hide
          ASF subversion and git services added a comment -

          Commit 1506635 from David Smiley in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1506635 ]

          LUCENE-5118: multiplier to spatial makeDistanceValueSource

          Show
          ASF subversion and git services added a comment - Commit 1506635 from David Smiley in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1506635 ] LUCENE-5118 : multiplier to spatial makeDistanceValueSource

            People

            • Assignee:
              David Smiley
              Reporter:
              David Smiley
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development