Remove radial restriction for GeoDistanceQuery
As of lucene 6.1 GeoDistanceQuery no longer requires restricting the radial distance in GeoPointDistanceQuery. closes #17578
This commit is contained in:
parent
7dff8fbb1d
commit
8dd4a6473e
|
@ -314,7 +314,10 @@ public class GeoDistanceQueryBuilder extends AbstractQueryBuilder<GeoDistanceQue
|
||||||
// if index created V_2_3 > use prefix encoded postings format
|
// if index created V_2_3 > use prefix encoded postings format
|
||||||
final GeoPointField.TermEncoding encoding = (indexVersionCreated.before(Version.V_2_3_0)) ?
|
final GeoPointField.TermEncoding encoding = (indexVersionCreated.before(Version.V_2_3_0)) ?
|
||||||
GeoPointField.TermEncoding.NUMERIC : GeoPointField.TermEncoding.PREFIX;
|
GeoPointField.TermEncoding.NUMERIC : GeoPointField.TermEncoding.PREFIX;
|
||||||
|
// Lucene 6.0 and earlier requires a radial restriction
|
||||||
|
if (indexVersionCreated.before(Version.V_5_0_0_alpha4)) {
|
||||||
normDistance = GeoUtils.maxRadialDistance(center, normDistance);
|
normDistance = GeoUtils.maxRadialDistance(center, normDistance);
|
||||||
|
}
|
||||||
return new GeoPointDistanceQuery(fieldType.name(), encoding, center.lat(), center.lon(), normDistance);
|
return new GeoPointDistanceQuery(fieldType.name(), encoding, center.lat(), center.lon(), normDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue