Class NearestNeighbor

java.lang.Object
org.apache.lucene.sandbox.search.NearestNeighbor

class NearestNeighbor extends Object
KNN search on top of 2D lat/lon indexed points.
  • Constructor Details

    • NearestNeighbor

      NearestNeighbor()
  • Method Details

    • nearest

      public static NearestNeighbor.NearestHit[] nearest(double pointLat, double pointLon, List<PointValues> readers, List<Bits> liveDocs, IntArrayList docBases, int n) throws IOException
      Throws:
      IOException
    • approxBestDistance

      private static double approxBestDistance(byte[] minPackedValue, byte[] maxPackedValue, double pointLat, double pointLon)
    • approxBestDistance

      private static double approxBestDistance(double minLat, double maxLat, double minLon, double maxLon, double pointLat, double pointLon)