public abstract class SpatialQueryBuilderFromCoordinates extends Object
Constructor and Description |
---|
SpatialQueryBuilderFromCoordinates() |
Modifier and Type | Method and Description |
---|---|
static Query |
buildDistanceQuery(Coordinates center,
double radius,
String fieldName)
Returns a Lucene Query searching directly by computing distance against
all docs in the index (costly !)
|
static Query |
buildDistanceQuery(Query approximationQuery,
Coordinates center,
double radius,
String coordinatesField)
Returns a Lucene query to match documents by distance to a center.
|
static Query |
buildDistanceQuery(Query approximationQuery,
Coordinates center,
double radius,
String latitudeField,
String longitudeField)
Returns a Lucene query to match documents by distance to a center.
|
static Query |
buildSpatialHashQuery(Coordinates center,
double radius,
String fieldName)
Returns a Lucene query to match documents by distance to a center,
relying only on spatial hashes.
|
static Query |
buildSpatialQueryByHash(Coordinates center,
double radius,
String fieldName)
Returns a Lucene query to match documents by distance to a center,
relying first on spatial hash to approximate the result, and then on a more
precise (but more costly)
DistanceQuery . |
static Query |
buildSpatialQueryByRange(Coordinates centerCoordinates,
double radius,
String fieldName)
Returns a Lucene Query which rely on double numeric range query
on Latitude / Longitude
|
public static Query buildSpatialHashQuery(Coordinates center, double radius, String fieldName)
center
- center of the search discusradius
- distance max to center in kmfieldName
- name of the Lucene Field implementing CoordinatesQuery
,
Coordinates
public static Query buildDistanceQuery(Query approximationQuery, Coordinates center, double radius, String coordinatesField)
center
- center of the search discusradius
- distance max to center in kmcoordinatesField
- name of the Lucene Field implementing CoordinatesapproximationQuery
- an approximation of the distance query
(i.e. a query returning all the results returned by the distance query,
but also some false positives).
WARNING: when passing null
, every single document will be scanned
(time/resource consuming!)Query
,
Coordinates
public static Query buildDistanceQuery(Query approximationQuery, Coordinates center, double radius, String latitudeField, String longitudeField)
center
- center of the search discusradius
- distance max to center in kmlatitudeField
- name of the Lucene Field hosting latitudelongitudeField
- name of the Lucene Field hosting longitudeapproximationQuery
- an approximation of the distance query
(i.e. a query returning all the results returned by the distance query,
but also some false positives).
WARNING: when passing null
, every single document will be scanned
(time/resource consuming!)Query
,
Coordinates
public static Query buildDistanceQuery(Coordinates center, double radius, String fieldName)
center
- center of the search discusradius
- distance max to center in kmfieldName
- name of the Lucene Field implementing CoordinatesQuery
,
Coordinates
public static Query buildSpatialQueryByHash(Coordinates center, double radius, String fieldName)
DistanceQuery
.center
- center of the search discusradius
- distance max to center in kmfieldName
- name of the Lucene Field implementing CoordinatesQuery
,
Coordinates
public static Query buildSpatialQueryByRange(Coordinates centerCoordinates, double radius, String fieldName)
centerCoordinates
- center of the search discusradius
- distance max to center in kmfieldName
- name of the Lucene Field implementing CoordinatesQuery
,
Coordinates
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved