Class GeolocationSort
- java.lang.Object
-
- co.elasticsearch.enterprisesearch.client.model.request.search.GeolocationSort
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeolocationSort.ModeHow to calculate distance in case a field has several geo points.
-
Constructor Summary
Constructors Constructor Description GeolocationSort(Geolocation geoLocation)Build a GeolocationSort from a central point
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeolocationgetCenter()Center point will be used to calculate the distance from that point to the field in each document, and return the results ordered by distance.GeolocationSort.ModegetMode()How to calculate distance in case a field has several geo points.Sort.OrdergetOrder()Gets the sort orderGeolocationSortsetMode(GeolocationSort.Mode mode)How to calculate distance in case a field has several geo points.GeolocationSortsetOrder(Sort.Order order)The sort order
-
-
-
Constructor Detail
-
GeolocationSort
public GeolocationSort(Geolocation geoLocation)
Build a GeolocationSort from a central point- Parameters:
geoLocation- the centeral geolocation point
-
-
Method Detail
-
getOrder
public Sort.Order getOrder()
Description copied from interface:SortOrderGets the sort order
-
getCenter
public Geolocation getCenter()
Center point will be used to calculate the distance from that point to the field in each document, and return the results ordered by distance. Center point can be specified using any of the geolocation field formats, see geolocation fields.- Returns:
- the center
-
getMode
public GeolocationSort.Mode getMode()
How to calculate distance in case a field has several geo points. By default, the shortest distance is taken into account when sorting in ascending order and the longest distance when sorting in descending order.- Returns:
- the sort mode
-
setMode
public GeolocationSort setMode(GeolocationSort.Mode mode)
How to calculate distance in case a field has several geo points. By default, the shortest distance is taken into account when sorting in ascending order and the longest distance when sorting in descending order.- Parameters:
mode- the sort mode- Returns:
this.
-
setOrder
public GeolocationSort setOrder(Sort.Order order)
The sort order- Parameters:
order- the sort order- Returns:
this.
-
-