Class SearchSort
java.lang.Object
com.couchbase.client.java.search.sort.SearchSort
- Direct Known Subclasses:
SearchSortField,SearchSortGeoDistance,SearchSortId,SearchSortScore
public abstract class SearchSort extends Object
Base class for all FTS sort options in querying.
- Since:
- 2.4.5
- Author:
- Michael Nitschinger
-
Constructor Summary
Constructors Modifier Constructor Description protectedSearchSort() -
Method Summary
Modifier and Type Method Description SearchSortdescending(boolean descending)protected abstract Stringidentifier()The identifier for the sort type, used in the "by" field.voidinjectParams(JsonObject queryJson)static SearchSortFieldsortField(String field)Sort by a field in the hits.static SearchSortGeoDistancesortGeoDistance(double locationLon, double locationLat, String field)Sort by geo location.static SearchSortIdsortId()Sort by the document identifier.static SearchSortScoresortScore()Sort by the hit score.
-
Constructor Details
-
SearchSort
protected SearchSort()
-
-
Method Details
-
identifier
The identifier for the sort type, used in the "by" field. -
injectParams
-
descending
-
sortId
Sort by the document identifier. -
sortScore
Sort by the hit score. -
sortField
Sort by a field in the hits.- Parameters:
field- the field name.
-
sortGeoDistance
public static SearchSortGeoDistance sortGeoDistance(double locationLon, double locationLat, String field)Sort by geo location.- Parameters:
locationLon- longitude of the location.locationLat- latitude of the location.field- the field name.
-