public final class DistanceQuery
extends org.apache.lucene.search.Query
SpatialFieldBridgeByRange
Use double lat,long field in the index from a Coordinates field declarationSpatialFieldBridgeByHash,
SpatialFieldBridgeByRange,
Coordinates| Constructor and Description |
|---|
DistanceQuery(org.apache.lucene.search.Query approximationQuery,
Coordinates centerCoordinates,
double radius,
String coordinatesField)
Construct a distance query to match document distant at most of radius from center Point
|
DistanceQuery(org.apache.lucene.search.Query approximationQuery,
Coordinates centerCoordinates,
double radius,
String latitudeField,
String longitudeField)
Construct a distance query to match document distant at most of radius from center Point
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.lucene.search.Weight |
createWeight(org.apache.lucene.search.IndexSearcher searcher,
boolean needsScores) |
boolean |
equals(Object obj) |
org.apache.lucene.search.Query |
getApproximationQuery() |
Point |
getCenter() |
String |
getCoordinatesField() |
double |
getRadius() |
int |
hashCode() |
org.apache.lucene.search.Query |
rewrite(org.apache.lucene.index.IndexReader reader) |
String |
toString(String field) |
public DistanceQuery(org.apache.lucene.search.Query approximationQuery,
Coordinates centerCoordinates,
double radius,
String coordinatesField)
approximationQuery - an approximation for this distance query
(i.e. a query that produces no false-negatives, but may produce false-positives), or null.
If non-null, only documents returned by the approximation query will be considered,
which will enhance performance.centerCoordinates - center of the search perimeterradius - radius of the search perimetercoordinatesField - name of the field implementing CoordinatesCoordinatespublic DistanceQuery(org.apache.lucene.search.Query approximationQuery,
Coordinates centerCoordinates,
double radius,
String latitudeField,
String longitudeField)
approximationQuery - an approximation for this distance query
(i.e. a query that produces no false-negatives, but may produce false-positives), or null.
If non-null, only documents returned by the approximation query will be considered,
which will enhance performance.centerCoordinates - center of the search perimeterradius - radius of the search perimeterlatitudeField - name of the field hosting latitudelongitudeField - name of the field hosting longitudeCoordinatespublic org.apache.lucene.search.Query rewrite(org.apache.lucene.index.IndexReader reader)
throws IOException
rewrite in class org.apache.lucene.search.QueryIOExceptionpublic org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.IndexSearcher searcher,
boolean needsScores)
throws IOException
createWeight in class org.apache.lucene.search.QueryIOExceptionpublic String getCoordinatesField()
public double getRadius()
public Point getCenter()
public org.apache.lucene.search.Query getApproximationQuery()
public int hashCode()
hashCode in class org.apache.lucene.search.Querypublic boolean equals(Object obj)
equals in class org.apache.lucene.search.QueryCopyright © 2006–2017 Hibernate. All rights reserved.