mirror of https://github.com/apache/lucene.git
improve distance facets example
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1570645 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
38b30d4fcb
commit
7ec6bd843b
|
@ -51,6 +51,7 @@ import org.apache.lucene.search.SortField;
|
|||
import org.apache.lucene.search.TopDocs;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.RAMDirectory;
|
||||
import org.apache.lucene.util.SloppyMath;
|
||||
|
||||
|
||||
|
||||
|
@ -146,7 +147,7 @@ public class DistanceFacetsExample implements Closeable {
|
|||
double originLatRadians = Math.toRadians(originLat);
|
||||
double originLngRadians = Math.toRadians(originLng);
|
||||
|
||||
double angle = maxDistanceKM / EARTH_RADIUS_KM;
|
||||
double angle = maxDistanceKM / (SloppyMath.earthDiameter(originLat) / 2.0);
|
||||
|
||||
double minLat = originLatRadians - angle;
|
||||
double maxLat = originLatRadians + angle;
|
||||
|
|
Loading…
Reference in New Issue