org.apache.lucene.spatial.geopoint.search

## Class GeoPointDistanceRangeQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.spatial.geopoint.search.GeoPointInBBoxQuery
    - - org.apache.lucene.spatial.geopoint.search.GeoPointDistanceQuery
      - - org.apache.lucene.spatial.geopoint.search.GeoPointDistanceRangeQuery

- All Implemented Interfaces:
    Cloneable

      public final class GeoPointDistanceRangeQuery
      extends GeoPointDistanceQuery

  Implements a point distance range query on a GeoPoint field. This is based on `org.apache.lucene.spatial.geopoint.search.GeoPointDistanceQuery` and is implemented using a `org.apache.lucene.search.BooleanClause.MUST_NOT` clause to exclude any points that fall within minRadiusMeters from the provided point.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected double` | `minRadiusMeters`

    - ### Fields inherited from class org.apache.lucene.spatial.geopoint.search.GeoPointDistanceQuery

      `centerLat, centerLon, radiusMeters`

    - ### Fields inherited from class org.apache.lucene.spatial.geopoint.search.GeoPointInBBoxQuery

      `field, maxLat, maxLon, minLat, minLon, termEncoding`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoPointDistanceRangeQuery(String field, double centerLon, double centerLat, double minRadiusMeters, double maxRadiusMeters)` Constructs a query for all `GeoPointField` types within a minimum / maximum distance (in meters) range from a given point
    `GeoPointDistanceRangeQuery(String field, GeoPointField.TermEncoding termEncoding, double centerLon, double centerLat, double minRadiusMeters, double maxRadius)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getMaxRadiusMeters()` getter method for maximum distance
    `double` | `getMinRadiusMeters()` getter method for minimum distance
    `Query` | `rewrite(IndexReader reader)`
    `String` | `toString(String field)`

    - ### Methods inherited from class org.apache.lucene.spatial.geopoint.search.GeoPointDistanceQuery

      `equals, getCenterLat, getCenterLon, getRadiusMeters, hashCode`

    - ### Methods inherited from class org.apache.lucene.spatial.geopoint.search.GeoPointInBBoxQuery

      `getField, getMaxLat, getMaxLon, getMinLat, getMinLon`

    - ### Methods inherited from class org.apache.lucene.search.Query

      `clone, createWeight, getBoost, setBoost, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### minRadiusMeters

          protected final double minRadiusMeters

  - ### Constructor Detail

    - #### GeoPointDistanceRangeQuery

          public GeoPointDistanceRangeQuery(String field,
                                    double centerLon,
                                    double centerLat,
                                    double minRadiusMeters,
                                    double maxRadiusMeters)

      Constructs a query for all `GeoPointField` types within a minimum / maximum distance (in meters) range from a given point

    - #### GeoPointDistanceRangeQuery

          public GeoPointDistanceRangeQuery(String field,
                                    GeoPointField.TermEncoding termEncoding,
                                    double centerLon,
                                    double centerLat,
                                    double minRadiusMeters,
                                    double maxRadius)

  - ### Method Detail

    - #### rewrite

          public Query rewrite(IndexReader reader)
                        throws IOException

      Overrides:
        `rewrite` in class `GeoPointDistanceQuery`
      Throws:
        `IOException`

    - #### toString

          public String toString(String field)

      Overrides:
        `toString` in class `GeoPointDistanceQuery`

    - #### getMinRadiusMeters

          public double getMinRadiusMeters()

      getter method for minimum distance

    - #### getMaxRadiusMeters

          public double getMaxRadiusMeters()

      getter method for maximum distance

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.