Description
GeoPointDistanceQuery handles dateline crossing by splitting the Minimum Bounding Rectangle (MBR) into east/west ranges and rewriting to a Boolean SHOULD. PostFiltering is accomplished by calculating the distance from the center point to the candidate point field. Unfortunately the center point is wrapped such that calculating the closest point on the "circle" from an eastern point to a western MBR provides incorrect results thus causing false negatives in the range creation. This was caught by a jenkins failure and reproduced in 2 places: GeoPointDistanceTermsEnum and TestGeoRelations