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
Attachments
Issue Links
- is related to
-
LUCENE-7974 Add N-dimensional FloatPoint K-nearest-neighbor implementation
- Closed