Package org.elasticsearch.search.sort
Class SortBuilders
java.lang.Object
org.elasticsearch.search.sort.SortBuilders
A set of static factory methods for
SortBuilders.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldSortBuilderConstructs a new field based sort.static GeoDistanceSortBuildergeoDistanceSort(String fieldName, double lat, double lon)A geo distance based sort.static GeoDistanceSortBuildergeoDistanceSort(String fieldName, String... geohashes)Constructs a new distance based sort on a geo point like field.static GeoDistanceSortBuildergeoDistanceSort(String fieldName, GeoPoint... points)Constructs a new distance based sort on a geo point like field.static FieldSortBuilderConstructs a sort tiebreaker that can be used within a point in time readerPointInTimeBuilder.static ScoreSortBuilderConstructs a new score sort.static ScriptSortBuilderscriptSort(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.
-