public final class DistanceFilter
extends org.apache.lucene.search.Filter
SpatialFieldBridgeByHash,
SpatialFieldBridgeByRange,
Coordinates| Constructor and Description |
|---|
DistanceFilter(org.apache.lucene.search.Filter previousFilter,
Coordinates centerCoordinates,
double radius,
String coordinatesField)
Construct a Distance Filter to match document distant at most of radius from center Point
|
DistanceFilter(org.apache.lucene.search.Filter previousFilter,
Coordinates centerCoordinates,
double radius,
String latitudeField,
String longitudeField)
Construct a Distance Filter to match document distant at most of radius from center Point
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.lucene.search.DocIdSet |
getDocIdSet(org.apache.lucene.index.AtomicReaderContext context,
org.apache.lucene.util.Bits acceptDocs)
Returns Doc Ids by retrieving their lat,long and checking if within distance(radius) of the center of the search
|
String |
toString() |
public DistanceFilter(org.apache.lucene.search.Filter previousFilter,
Coordinates centerCoordinates,
double radius,
String coordinatesField)
previousFilter - previous Filter in the chain. As Distance is costly by retrieving the lat and long field
it is better to use it lastcenterCoordinates - center of the search perimeterradius - radius of the search perimetercoordinatesField - name of the field implementing CoordinatesCoordinatespublic DistanceFilter(org.apache.lucene.search.Filter previousFilter,
Coordinates centerCoordinates,
double radius,
String latitudeField,
String longitudeField)
previousFilter - previous Filter in the chain. As Distance is costly by retrieving the lat and long field
it is better to use it lastcenterCoordinates - 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.DocIdSet getDocIdSet(org.apache.lucene.index.AtomicReaderContext context,
org.apache.lucene.util.Bits acceptDocs)
throws IOException
getDocIdSet in class org.apache.lucene.search.Filterreader - reader to the indexIOExceptionCopyright © 2006–2015 Hibernate. All rights reserved.