public final class DistanceFilter extends Filter
SpatialFieldBridgeByHash
,
SpatialFieldBridgeByRange
,
Coordinates
Constructor and Description |
---|
DistanceFilter(Filter previousFilter,
Coordinates centerCoordinates,
double radius,
String coordinatesField)
Construct a Distance Filter to match document distant at most of radius from center Point
|
DistanceFilter(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 |
---|---|
boolean |
equals(Object obj) |
DocIdSet |
getDocIdSet(LeafReaderContext context,
Bits acceptDocs)
Returns Doc Ids by retrieving their latitude,longitude and checking if within distance(radius) of the center of the search
|
int |
hashCode() |
String |
toString(String field) |
public DistanceFilter(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 CoordinatesCoordinates
public DistanceFilter(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 longitudeCoordinates
public DocIdSet getDocIdSet(LeafReaderContext context, Bits acceptDocs) throws IOException
getDocIdSet
in class Filter
context
- the LeafReaderContext
for which to return the {LeafReaderContext}.acceptDocs
- Bits that represent the allowable docs to match (typically deleted docs but possibly filtering
other documents)DocIdSet
with the matching document idsIOException
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved