Package org.elasticsearch.search.sort
Class SortBuilders
java.lang.Object
org.elasticsearch.search.sort.SortBuilders
public class SortBuilders
extends java.lang.Object
A set of static factory methods for
SortBuilder
s.-
Constructor Summary
Constructors Constructor Description SortBuilders()
-
Method Summary
Modifier and Type Method Description static FieldSortBuilder
fieldSort(java.lang.String field)
Constructs a new field based sort.static GeoDistanceSortBuilder
geoDistanceSort(java.lang.String fieldName, double lat, double lon)
A geo distance based sort.static GeoDistanceSortBuilder
geoDistanceSort(java.lang.String fieldName, java.lang.String... geohashes)
Constructs a new distance based sort on a geo point like field.static GeoDistanceSortBuilder
geoDistanceSort(java.lang.String fieldName, GeoPoint... points)
Constructs a new distance based sort on a geo point like field.static ScoreSortBuilder
scoreSort()
Constructs a new score sort.static ScriptSortBuilder
scriptSort(Script script, ScriptSortBuilder.ScriptSortType type)
Constructs a new script based sort.
-
Constructor Details
-
SortBuilders
public SortBuilders()
-
-
Method Details
-
scoreSort
Constructs a new score sort. -
fieldSort
Constructs a new field based sort.- Parameters:
field
- The field name.
-
scriptSort
Constructs a new script based sort.- Parameters:
script
- The script to use.type
- The type, can either be "string" or "number".
-
geoDistanceSort
public static GeoDistanceSortBuilder geoDistanceSort(java.lang.String fieldName, double lat, double lon)A geo distance based sort.- Parameters:
fieldName
- The geo point like field name.lat
- Latitude of the point to create the range distance facets from.lon
- Longitude of the point to create the range distance facets from.
-
geoDistanceSort
public static GeoDistanceSortBuilder geoDistanceSort(java.lang.String fieldName, GeoPoint... points)Constructs a new distance based sort on a geo point like field.- Parameters:
fieldName
- The geo point like field name.points
- The points to create the range distance facets from.
-
geoDistanceSort
public static GeoDistanceSortBuilder geoDistanceSort(java.lang.String fieldName, java.lang.String... geohashes)Constructs a new distance based sort on a geo point like field.- Parameters:
fieldName
- The geo point like field name.geohashes
- The points to create the range distance facets from.
-