You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/05/20 08:38:24 UTC

[GitHub] [lucene] jpountz commented on a diff in pull request #897: LUCENE-10266 Move nearest-neighbor search on points to core

jpountz commented on code in PR #897:
URL: https://github.com/apache/lucene/pull/897#discussion_r877887683


##########
lucene/core/src/java/org/apache/lucene/document/LatLonPoint.java:
##########
@@ -362,4 +377,72 @@ public static Query newDistanceFeatureQuery(
     }
     return query;
   }
+
+  /**
+   * Finds the {@code n} nearest indexed points to the provided point, according to Haversine
+   * distance.
+   *
+   * <p>This is functionally equivalent to running {@link MatchAllDocsQuery} with a {@link
+   * LatLonDocValuesField#newDistanceSort}, but is far more efficient since it takes advantage of
+   * properties the indexed BKD tree. Currently this only works with {@link Lucene90PointsFormat}

Review Comment:
   this point that it only works with Lucene90PointsFormat is no longer true, can you remove it?



##########
lucene/core/src/java/org/apache/lucene/search/NearestNeighbor.java:
##########
@@ -31,12 +31,8 @@
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.SloppyMath;
 
-/**
- * KNN search on top of 2D lat/lon indexed points.
- *
- * @lucene.experimental
- */
-class NearestNeighbor {
+/** KNN search on top of 2D lat/lon indexed points. */
+public class NearestNeighbor {

Review Comment:
   Can we keep it pkg-private if we have it in oal.document? This is especially important as we're promoting this class to core.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org