Class SearchSortingBuilder
- All Implemented Interfaces:
Builder<SearchSorting>
Example to create an instance using the builder pattern
SearchSorting searchSorting = SearchSorting.builder()
.field("{field}")
.order(SearchSortOrder.ASC)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds SearchSorting with checking for non-null required valuesbuilds SearchSorting without checking for non-null required valuesUse any searchable field of the resource as sort criterion, or"score"
to sort by relevance score calculated by the API.fieldType
(SearchFieldType fieldType) Provide the data type of the givenfield
.filter
(SearchQueryExpression filter) Allows you to apply a sort filter.Allows you to apply a sort filter.getField()
Use any searchable field of the resource as sort criterion, or"score"
to sort by relevance score calculated by the API.Provide the data type of the givenfield
.Allows you to apply a sort filter.String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47.getMode()
Specify the sort mode to be applied for a set-typefield
.getOrder()
Specify the order in which the search results should be sorted.String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47.mode
(SearchSortMode mode) Specify the sort mode to be applied for a set-typefield
.static SearchSortingBuilder
of()
factory method for an instance of SearchSortingBuilderstatic SearchSortingBuilder
of
(SearchSorting template) create builder for SearchSorting instanceorder
(SearchSortOrder order) Specify the order in which the search results should be sorted.Allows you to apply a sort filter.
-
Constructor Details
-
SearchSortingBuilder
public SearchSortingBuilder()
-
-
Method Details
-
field
Use any searchable field of the resource as sort criterion, or
"score"
to sort by relevance score calculated by the API.- Parameters:
field
- value to be set- Returns:
- Builder
-
language
String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example:
en
,en-US
,zh-Hans-SG
.- Parameters:
language
- value to be set- Returns:
- Builder
-
order
Specify the order in which the search results should be sorted. Can be
asc
for ascending, ordesc
for descending order.- Parameters:
order
- value to be set- Returns:
- Builder
-
mode
Specify the sort mode to be applied for a set-type
field
.- Parameters:
mode
- value to be set- Returns:
- Builder
-
fieldType
Provide the data type of the given
field
.- Parameters:
fieldType
- value to be set- Returns:
- Builder
-
filter
public SearchSortingBuilder filter(Function<SearchQueryExpressionBuilder, SearchQueryExpressionBuilder> builder) Allows you to apply a sort filter.
- Parameters:
builder
- function to build the filter value- Returns:
- Builder
-
withFilter
public SearchSortingBuilder withFilter(Function<SearchQueryExpressionBuilder, SearchQueryExpression> builder) Allows you to apply a sort filter.
- Parameters:
builder
- function to build the filter value- Returns:
- Builder
-
filter
Allows you to apply a sort filter.
- Parameters:
filter
- value to be set- Returns:
- Builder
-
getField
Use any searchable field of the resource as sort criterion, or
"score"
to sort by relevance score calculated by the API.- Returns:
- field
-
getLanguage
String value specifying linguistic and regional preferences using the IETF language tag format, as described in BCP 47. The format combines language, script, and region using hyphen-separated subtags. For example:
en
,en-US
,zh-Hans-SG
.- Returns:
- language
-
getOrder
Specify the order in which the search results should be sorted. Can be
asc
for ascending, ordesc
for descending order.- Returns:
- order
-
getMode
Specify the sort mode to be applied for a set-type
field
.- Returns:
- mode
-
getFieldType
Provide the data type of the given
field
.- Returns:
- fieldType
-
getFilter
Allows you to apply a sort filter.
- Returns:
- filter
-
build
builds SearchSorting with checking for non-null required values- Specified by:
build
in interfaceBuilder<SearchSorting>
- Returns:
- SearchSorting
-
buildUnchecked
builds SearchSorting without checking for non-null required values- Returns:
- SearchSorting
-
of
factory method for an instance of SearchSortingBuilder- Returns:
- builder
-
of
create builder for SearchSorting instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-