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 BoundaryBoxFilter lngFilter;
|
||||||
public DistanceFilter distanceFilter;
|
public DistanceFilter distanceFilter;
|
||||||
|
|
||||||
private double lat;
|
private final double lat;
|
||||||
private double lng;
|
private final double lng;
|
||||||
private double miles;
|
private final double miles;
|
||||||
private Filter cartesianFilter;
|
private Filter cartesianFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,12 +74,9 @@ public class DistanceQueryBuilder {
|
||||||
* @param miles
|
* @param miles
|
||||||
*/
|
*/
|
||||||
public Filter getFilter() {
|
public Filter getFilter() {
|
||||||
|
return new SerialChainFilter(new Filter[] {cartesianFilter, distanceFilter},
|
||||||
return new SerialChainFilter(new Filter[] {cartesianFilter, distanceFilter},
|
|
||||||
new int[] {SerialChainFilter.AND,
|
new int[] {SerialChainFilter.AND,
|
||||||
SerialChainFilter.SERIALAND});
|
SerialChainFilter.SERIALAND});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Filter getFilter(Query query) {
|
public Filter getFilter(Query query) {
|
||||||
|
@ -96,6 +93,18 @@ public class DistanceQueryBuilder {
|
||||||
public Query getQuery() {
|
public Query getQuery() {
|
||||||
return new ConstantScoreQuery(getFilter());
|
return new ConstantScoreQuery(getFilter());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getLat() {
|
||||||
|
return lat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLng() {
|
||||||
|
return lng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getMiles() {
|
||||||
|
return miles;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
Loading…
Reference in New Issue