public class DistanceFacetsExample
extends java.lang.Object
implements java.io.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(java.lang.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 void index() throws java.io.IOException
java.io.IOException
public static Query getBoundingBoxQuery(double originLat, double originLng, double maxDistanceKM)
public FacetResult search() throws java.io.IOException
java.io.IOException
public TopDocs drillDown(DoubleRange range) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.