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

Add LatLonPoint.nearest to find closest indexed point to a given query point

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.1, 7.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      KD trees (used by Lucene's new dimensional points) excel at finding "nearest neighbors" to a given query point ... I think we should add this to Lucene's sandbox as:

        public static Document nearest(IndexReader r, String field, double lat, double lon) throws IOException
      

      I only implemented the 1 nearest neighbor for starters ... I think we can easily generalize this in the future to K nearest.

      It could also be generalized to more than 2 dimensions, but for now I'm making the class package private in sandbox for just the geo2d (lat/lon) use case.

      I don't think this should go into 6.0.0, but should go into 6.1: it's a new feature, and we need to wrap up and ship 6.0.0 already

        Attachments

        1. LUCENE-7069.patch
          32 kB
          Michael McCandless
        2. LUCENE-7069.patch
          32 kB
          Michael McCandless
        3. LUCENE-7069.patch
          17 kB
          Michael McCandless
        4. LUCENE-7069.patch
          16 kB
          Michael McCandless

          Issue Links

            Activity

              People

              • Assignee:
                mikemccand Michael McCandless
                Reporter:
                mikemccand Michael McCandless
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: