public static class GeolocationContextMapping.Builder extends ContextBuilder<GeolocationContextMapping>
name
Modifier | Constructor and Description |
---|---|
protected |
Builder(String name) |
protected |
Builder(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(String geohash)
Set a default location that should be used, if no location is
provided by the query
|
GeolocationContextMapping.Builder |
addDefaultLocations(Collection<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(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(String precision)
Set the precision use o make suggestions
|
category, category, loadMapping, loadMappings, location, location, reference, reference
protected Builder(String name)
protected Builder(String name, boolean neighbors, int... levels)
public GeolocationContextMapping.Builder precision(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(String geohash)
geohash
- geohash of the default locationpublic GeolocationContextMapping.Builder addDefaultLocations(Collection<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(String fieldName)
fieldName
- name of the fieldpublic GeolocationContextMapping build()
build
in class ContextBuilder<GeolocationContextMapping>
Copyright © 2009–2016. All rights reserved.