public static class GeolocationContextMapping.Builder extends ContextBuilder<GeolocationContextMapping>
name
Modifier | Constructor and Description |
---|---|
protected |
Builder(java.lang.String name) |
protected |
Builder(java.lang.String name,
boolean neighbors,
int... levels) |
Modifier and Type | Method and Description |
---|---|
GeolocationContextMapping.Builder |
addDefaultLocation(double lat,
double lon)
Set a default location that should be used, if no location is
provided by the query
|
GeolocationContextMapping.Builder |
addDefaultLocation(java.lang.String geohash)
Set a default location that should be used, if no location is
provided by the query
|
GeolocationContextMapping.Builder |
addDefaultLocations(java.util.Collection<java.lang.String> geohashes)
Set a default location that should be used, if no location is
provided by the query
|
GeolocationContextMapping |
build() |
GeolocationContextMapping.Builder |
defaultLocation(GeoPoint point)
Set a default location that should be used, if no location is
provided by the query
|
GeolocationContextMapping.Builder |
field(java.lang.String fieldName)
Set the name of the field containing a geolocation to use
|
GeolocationContextMapping.Builder |
neighbors(boolean neighbors)
Set neighborhood usage
|
GeolocationContextMapping.Builder |
precision(double meters)
Set the precision use o make suggestions
|
GeolocationContextMapping.Builder |
precision(double precision,
DistanceUnit unit)
Set the precision use o make suggestions
|
GeolocationContextMapping.Builder |
precision(int level)
Set the precision use o make suggestions
|
GeolocationContextMapping.Builder |
precision(java.lang.String precision)
Set the precision use o make suggestions
|
category, category, loadMapping, loadMappings, location, location, reference, reference
protected Builder(java.lang.String name)
protected Builder(java.lang.String name, boolean neighbors, int... levels)
public GeolocationContextMapping.Builder precision(java.lang.String precision)
precision
- precision as distance with DistanceUnit
. Default:
meterspublic GeolocationContextMapping.Builder precision(double precision, DistanceUnit unit)
precision
- precision valueunit
- DistanceUnit
to usepublic GeolocationContextMapping.Builder precision(double meters)
meters
- precision as distance in meterspublic GeolocationContextMapping.Builder precision(int level)
level
- maximum length of geohashespublic GeolocationContextMapping.Builder neighbors(boolean neighbors)
neighbors
- should neighbor cells also be validpublic GeolocationContextMapping.Builder addDefaultLocation(java.lang.String geohash)
geohash
- geohash of the default locationpublic GeolocationContextMapping.Builder addDefaultLocations(java.util.Collection<java.lang.String> geohashes)
geohashes
- geohash of the default locationpublic GeolocationContextMapping.Builder addDefaultLocation(double lat, double lon)
lat
- latitude of the default locationlon
- longitude of the default locationpublic GeolocationContextMapping.Builder defaultLocation(GeoPoint point)
point
- locationpublic GeolocationContextMapping.Builder field(java.lang.String fieldName)
fieldName
- name of the fieldpublic GeolocationContextMapping build()
build
in class ContextBuilder<GeolocationContextMapping>