public abstract class ConnectedSortAdditionalSortFieldContext extends AbstractConnectedSortContext implements SortAdditionalSortFieldContext
queryContext, states| Constructor and Description |
|---|
ConnectedSortAdditionalSortFieldContext(QueryBuildingContext queryContext,
SortFieldStates states) |
| Modifier and Type | Method and Description |
|---|---|
SortDistanceNoFieldContext |
andByDistance()
Order elements by distance.
|
SortFieldContext |
andByField(String field)
Order elements by the value of a specific field.
|
SortFieldContext |
andByField(String field,
org.apache.lucene.search.SortField.Type sortFieldType)
Order elements by value of a specific field, with the sort field type provided.
|
SortOrderTermination |
andByIndexOrder()
Order elements by their internal index order.
|
SortNativeContext |
andByNative(org.apache.lucene.search.SortField sortField)
Order element using the native backend API for Lucene.
|
SortNativeContext |
andByNative(String sortField,
String nativeDescription)
Order element using the native backend API for Elasticsearch.
|
SortScoreContext |
andByScore()
Order elements by their relevance score.
|
getQueryContext, getStatespublic ConnectedSortAdditionalSortFieldContext(QueryBuildingContext queryContext, SortFieldStates states)
public SortFieldContext andByField(String field)
SortAdditionalSortFieldContextThe default order is ascending.
The sort field type will be determined automatically if possible, and an exception will be thrown if it is not possible. Automatically determining the type is impossible in particular if a custom field bridge is defined on the given field.
andByField in interface SortAdditionalSortFieldContextfield - The name of the index field to sort bySortContext.byField(String),
The alternative for
numeric fields with custom field bridges.public SortFieldContext andByField(String field, org.apache.lucene.search.SortField.Type sortFieldType)
SortAdditionalSortFieldContextThe default order is ascending.
Note: using this method is only required when sorting on a
field on which a custom field bridge is defined. Otherwise, one may simply use
SortAdditionalSortFieldContext.andByField(String).
andByField in interface SortAdditionalSortFieldContextfield - The name of the index field to sort bysortFieldType - The sort field typeSortAdditionalSortFieldContext.andByField(String, org.apache.lucene.search.SortField.Type)public SortScoreContext andByScore()
SortAdditionalSortFieldContextThe default order is descending, i.e. higher scores come first.
andByScore in interface SortAdditionalSortFieldContextSortContext.byScore()public SortOrderTermination andByIndexOrder()
SortAdditionalSortFieldContextandByIndexOrder in interface SortAdditionalSortFieldContextSortContext.byIndexOrder()public SortDistanceNoFieldContext andByDistance()
SortAdditionalSortFieldContextThe default order is ascending, i.e. shorter distances come first.
The distance is computed between the value of a field carrying coordinates
(to be provided in the next context)
and reference coordinates.
andByDistance in interface SortAdditionalSortFieldContextSortContext.byDistance()public SortNativeContext andByNative(org.apache.lucene.search.SortField sortField)
SortAdditionalSortFieldContextThe sort order (ascending/descending) is defined in sortField
andByNative in interface SortAdditionalSortFieldContextsortField - The sort field to be added to the sort list.SortContext.byNative(SortField)public SortNativeContext andByNative(String sortField, String nativeDescription)
SortAdditionalSortFieldContextandByNative in interface SortAdditionalSortFieldContextsortField - The name of the index field to sort bynativeDescription - The sort field description, as valid JSON. This may be a
simple quoted string (e.g. "'asc'") or a JSON map (e.g. "{'key': 'value'}"). See
Elasticsearch's documentation for information about the exact syntax.SortContext.byNative(String, String)Copyright © 2006–2016 Hibernate. All rights reserved.