|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.demo.facet.DistanceFacetsExample
public class DistanceFacetsExample
Shows simple usage of dynamic range faceting, using the expressions module to calculate distance.
Field Summary | |
---|---|
static double |
EARTH_RADIUS_KM
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 Summary | |
---|---|
DistanceFacetsExample()
Empty constructor |
Method Summary | |
---|---|
void |
close()
|
TopDocs |
drillDown(DoubleRange range)
User drills down on the specified range. |
static Filter |
getBoundingBoxFilter(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double ORIGIN_LATITUDE
public static final double ORIGIN_LONGITUDE
public static final double EARTH_RADIUS_KM
Constructor Detail |
---|
public DistanceFacetsExample()
Method Detail |
---|
public void index() throws IOException
IOException
public static Filter getBoundingBoxFilter(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
IOException
public static void main(String[] args) throws Exception
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |