Lucene - Core
  1. Lucene - Core
  2. LUCENE-5271

A slightly more accurate SloppyMath distance

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7, Trunk
    • Component/s: modules/other
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      SloppyMath, intriduced in LUCENE-5258, uses earth's avg. (according to WGS84) ellipsoid radius as an approximation for computing the "spherical" distance. (The TO_KILOMETERS constant).

      While this is pretty accurate for long distances (latitude wise) this may introduce some small errors while computing distances close to the equator (as the earth radius there is larger than the avg.)

      A more accurate approximation would be taking the avg. earth radius at the source and destination points. But computing an ellipsoid radius at any given point is a heavy function, and this distance should be used in a scoring function.. So two optimizations are optional -

      • Pre-compute a table with an earth radius per latitude (the longitude does not affect the radius)
      • Instead of using two point radius avg, figure out the avg. latitude (exactly between the src and dst points) and get its radius.
      1. LUCENE-5271.patch
        6 kB
        Gilad Barkai
      2. LUCENE-5271.patch
        5 kB
        Gilad Barkai
      3. LUCENE-5271.patch
        3 kB
        Gilad Barkai

        Activity

        Gilad Barkai created issue -
        Gilad Barkai made changes -
        Field Original Value New Value
        Attachment LUCENE-5271.patch [ 12607727 ]
        Gilad Barkai made changes -
        Attachment LUCENE-5271.patch [ 12614303 ]
        Gilad Barkai made changes -
        Attachment LUCENE-5271.patch [ 12617626 ]
        Ryan Ernst made changes -
        Assignee Ryan Ernst [ rjernst ]
        Ryan Ernst made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0 [ 12321663 ]
        Fix Version/s 4.7 [ 12325572 ]
        Resolution Fixed [ 1 ]
        David Smiley made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Ryan Ernst
            Reporter:
            Gilad Barkai
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development