Package org.elasticsearch.search.sort
Class SortBuilders
java.lang.Object
org.elasticsearch.search.sort.SortBuilders
A set of static factory methods for
SortBuilder
s.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic FieldSortBuilder
Constructs a new field based sort.static GeoDistanceSortBuilder
geoDistanceSort
(String fieldName, double lat, double lon) A geo distance based sort.static GeoDistanceSortBuilder
geoDistanceSort
(String fieldName, String... geohashes) Constructs a new distance based sort on a geo point like field.static GeoDistanceSortBuilder
geoDistanceSort
(String fieldName, GeoPoint... points) Constructs a new distance based sort on a geo point like field.static FieldSortBuilder
Constructs a sort tiebreaker that can be used within a point in time readerPointInTimeBuilder
.static ScoreSortBuilder
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.
-
pitTiebreaker
Constructs a sort tiebreaker that can be used within a point in time readerPointInTimeBuilder
. -
scriptSort
Constructs a new script based sort.- Parameters:
script
- The script to use.type
- The type, can either be "string" or "number".
-
geoDistanceSort
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
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
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.
-