Companion

object Companion

Properties

Link copied to clipboard
const val BYTES: Int

LatLonPoint is encoded as integer values so number of bytes is 4

Link copied to clipboard

Type for an indexed LatLonPoint

Functions

Link copied to clipboard
fun checkCompatible(fieldInfo: FieldInfo)

helper: checks a fieldinfo and throws exception if its definitely not a LatLonPoint

Link copied to clipboard
fun nearest(searcher: IndexSearcher, field: String, latitude: Double, longitude: Double, n: Int): TopFieldDocs

Finds the n nearest indexed points to the provided point, according to Haversine distance.

Link copied to clipboard
fun newBoxQuery(field: String?, minLatitude: Double, maxLatitude: Double, minLongitude: Double, maxLongitude: Double): Query

Create a query for matching a bounding box.

Link copied to clipboard
fun newDistanceFeatureQuery(field: String, weight: Float, originLat: Double, originLon: Double, pivotDistanceMeters: Double): Query

Given a field that indexes point values into a LatLonPoint and doc values into [ ], this returns a query that scores documents based on their haversine distance in meters to (originLat, originLon): score = weight * pivotDistanceMeters / (pivotDistanceMeters + distance), ie. score is in the [0, weight] range, is equal to weight when the document's value is equal to (originLat, originLon) and is equal to weight/2 when the document's value is distant of pivotDistanceMeters from (originLat, originLon). In case of multi-valued fields, only the closest point to (originLat, originLon) will be considered. This query is typically useful to boost results based on distance by adding this query to a clause of a BooleanQuery.

Link copied to clipboard
fun newDistanceQuery(field: String?, latitude: Double, longitude: Double, radiusMeters: Double): Query

Create a query for matching points within the specified distance of the supplied location.

Link copied to clipboard
fun newGeometryQuery(field: String?, queryRelation: ShapeField.QueryRelation, vararg latLonGeometries: LatLonGeometry): Query

Create a query for matching one or more geometries against the provided [ ]. Line geometries are not supported for WITHIN relationship.

Link copied to clipboard
fun newPolygonQuery(field: String?, vararg polygons: Polygon): Query

Create a query for matching one or more polygons.