public class DistanceFacetsExample extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
static double |
EARTH_RADIUS_KM
Mean radius of the Earth in KM
NOTE: this is approximate, because the earth is a bit
wider at the equator than the poles.
|
static double |
ORIGIN_LATITUDE
The "home" latitude.
|
static double |
ORIGIN_LONGITUDE
The "home" longitude.
|
Constructor and Description |
---|
DistanceFacetsExample()
Empty constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
TopDocs |
drillDown(DoubleRange range)
User drills down on the specified range.
|
static Query |
getBoundingBoxQuery(double originLat,
double originLng,
double maxDistanceKM)
Given a latitude and longitude (in degrees) and the
maximum great circle (surface of the earth) distance,
returns a simple Filter bounding box to "fast match"
candidates.
|
void |
index()
Build the example index.
|
static void |
main(String[] args)
Runs the search and drill-down examples and prints the results.
|
FacetResult |
search()
User runs a query and counts facets.
|
public static final double ORIGIN_LATITUDE
public static final double ORIGIN_LONGITUDE
public static final double EARTH_RADIUS_KM
public DistanceFacetsExample()
public void index() throws IOException
IOException
public static Query getBoundingBoxQuery(double originLat, double originLng, double maxDistanceKM)
public FacetResult search() throws IOException
IOException
public TopDocs drillDown(DoubleRange range) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.