mirror of https://github.com/apache/lucene.git
LUCENE-1387 -- expose getLat/getLng from DistanceQueryBuilder
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@730653 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c9e7642bae
commit
1f585f0357
|
@ -32,9 +32,9 @@ public class DistanceQueryBuilder {
|
|||
public BoundaryBoxFilter lngFilter;
|
||||
public DistanceFilter distanceFilter;
|
||||
|
||||
private double lat;
|
||||
private double lng;
|
||||
private double miles;
|
||||
private final double lat;
|
||||
private final double lng;
|
||||
private final double miles;
|
||||
private Filter cartesianFilter;
|
||||
|
||||
/**
|
||||
|
@ -74,12 +74,9 @@ public class DistanceQueryBuilder {
|
|||
* @param miles
|
||||
*/
|
||||
public Filter getFilter() {
|
||||
|
||||
return new SerialChainFilter(new Filter[] {cartesianFilter, distanceFilter},
|
||||
return new SerialChainFilter(new Filter[] {cartesianFilter, distanceFilter},
|
||||
new int[] {SerialChainFilter.AND,
|
||||
SerialChainFilter.SERIALAND});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Filter getFilter(Query query) {
|
||||
|
@ -96,6 +93,18 @@ public class DistanceQueryBuilder {
|
|||
public Query getQuery() {
|
||||
return new ConstantScoreQuery(getFilter());
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public double getLng() {
|
||||
return lng;
|
||||
}
|
||||
|
||||
public double getMiles() {
|
||||
return miles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
Loading…
Reference in New Issue