Class FieldSortOptionsStepImpl<PDF extends SearchPredicateFactory>
- java.lang.Object
-
- org.hibernate.search.engine.search.sort.dsl.spi.AbstractSortThenStep
-
- org.hibernate.search.engine.search.sort.dsl.impl.FieldSortOptionsStepImpl<PDF>
-
- All Implemented Interfaces:
FieldSortMissingValueBehaviorStep<FieldSortOptionsStepImpl<PDF>>,FieldSortOptionsStep<FieldSortOptionsStepImpl<PDF>,PDF>,SortFilterStep<FieldSortOptionsStepImpl<PDF>,PDF>,SortFinalStep,SortModeStep<FieldSortOptionsStepImpl<PDF>>,SortOrderStep<FieldSortOptionsStepImpl<PDF>>,SortThenStep
public class FieldSortOptionsStepImpl<PDF extends SearchPredicateFactory> extends AbstractSortThenStep implements FieldSortOptionsStep<FieldSortOptionsStepImpl<PDF>,PDF>, FieldSortMissingValueBehaviorStep<FieldSortOptionsStepImpl<PDF>>
-
-
Constructor Summary
Constructors Constructor Description FieldSortOptionsStepImpl(SearchSortDslContext<?,? extends PDF> dslContext, String fieldPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SearchSortbuild()FieldSortOptionsStepImpl<PDF>filter(Function<? super PDF,? extends PredicateFinalStep> clauseContributor)Filter nested objects from which values will be extracted for this sort.FieldSortOptionsStepImpl<PDF>filter(SearchPredicate searchPredicate)Filter nested objects from which values will be extracted for this sort.FieldSortOptionsStepImpl<PDF>first()Put documents with missing values first in the sorting.FieldSortOptionsStepImpl<PDF>highest()Give documents with missing values the highest value when sorting.FieldSortOptionsStepImpl<PDF>last()Put documents with missing values last in the sorting.FieldSortOptionsStepImpl<PDF>lowest()Give documents with missing values the lowest value when sorting.FieldSortMissingValueBehaviorStep<FieldSortOptionsStepImpl<PDF>>missing()Start describing the behavior of this sort when a document doesn't have any value for the targeted field.FieldSortOptionsStepImpl<PDF>mode(SortMode mode)Start describing the behavior of this sort when a document has multiple values for the targeted field.FieldSortOptionsStepImpl<PDF>order(SortOrder order)Sort in the given order.FieldSortOptionsStepImpl<PDF>use(Object value, ValueConvert convert)When documents are missing a value on the sort field, use the given value instead.-
Methods inherited from class org.hibernate.search.engine.search.sort.dsl.spi.AbstractSortThenStep
then, toSort
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.engine.search.sort.dsl.FieldSortMissingValueBehaviorStep
use
-
Methods inherited from interface org.hibernate.search.engine.search.sort.dsl.SortFilterStep
filter
-
Methods inherited from interface org.hibernate.search.engine.search.sort.dsl.SortFinalStep
toSort
-
Methods inherited from interface org.hibernate.search.engine.search.sort.dsl.SortOrderStep
asc, desc
-
Methods inherited from interface org.hibernate.search.engine.search.sort.dsl.SortThenStep
then
-
-
-
-
Constructor Detail
-
FieldSortOptionsStepImpl
public FieldSortOptionsStepImpl(SearchSortDslContext<?,? extends PDF> dslContext, String fieldPath)
-
-
Method Detail
-
order
public FieldSortOptionsStepImpl<PDF> order(SortOrder order)
Description copied from interface:SortOrderStepSort in the given order.- Specified by:
orderin interfaceSortOrderStep<PDF extends SearchPredicateFactory>- Parameters:
order- The order.- Returns:
this, for method chaining.
-
mode
public FieldSortOptionsStepImpl<PDF> mode(SortMode mode)
Description copied from interface:SortModeStepStart describing the behavior of this sort when a document has multiple values for the targeted field.- Specified by:
modein interfaceSortModeStep<PDF extends SearchPredicateFactory>- Parameters:
mode- The mode.- Returns:
this, for method chaining.
-
missing
public FieldSortMissingValueBehaviorStep<FieldSortOptionsStepImpl<PDF>> missing()
Description copied from interface:FieldSortOptionsStepStart describing the behavior of this sort when a document doesn't have any value for the targeted field.- Specified by:
missingin interfaceFieldSortOptionsStep<FieldSortOptionsStepImpl<PDF extends SearchPredicateFactory>,PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
filter
public FieldSortOptionsStepImpl<PDF> filter(Function<? super PDF,? extends PredicateFinalStep> clauseContributor)
Description copied from interface:SortFilterStepFilter nested objects from which values will be extracted for this sort.The filter is defined by the given function.
Best used with lambda expressions.
- Specified by:
filterin interfaceSortFilterStep<FieldSortOptionsStepImpl<PDF extends SearchPredicateFactory>,PDF extends SearchPredicateFactory>- Parameters:
clauseContributor- A function that will use the factory passed in parameter to create a predicate, returning the final step in the predicate DSL. Should generally be a lambda expression.- Returns:
this, for method chaining.
-
filter
public FieldSortOptionsStepImpl<PDF> filter(SearchPredicate searchPredicate)
Description copied from interface:SortFilterStepFilter nested objects from which values will be extracted for this sort.The filter is based on a previously-built
SearchPredicate.- Specified by:
filterin interfaceSortFilterStep<FieldSortOptionsStepImpl<PDF extends SearchPredicateFactory>,PDF extends SearchPredicateFactory>- Parameters:
searchPredicate- The predicate that must match.- Returns:
this, for method chaining.
-
first
public FieldSortOptionsStepImpl<PDF> first()
Description copied from interface:FieldSortMissingValueBehaviorStepPut documents with missing values first in the sorting.This instruction is independent of whether the sort is being ascending or descending.
- Specified by:
firstin interfaceFieldSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
last
public FieldSortOptionsStepImpl<PDF> last()
Description copied from interface:FieldSortMissingValueBehaviorStepPut documents with missing values last in the sorting.This instruction is independent of whether the sort is being ascending or descending.
- Specified by:
lastin interfaceFieldSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
highest
public FieldSortOptionsStepImpl<PDF> highest()
Description copied from interface:FieldSortMissingValueBehaviorStepGive documents with missing values the highest value when sorting.This puts documents with missing values last when using ascending order, or first when using descending order.
- Specified by:
highestin interfaceFieldSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
lowest
public FieldSortOptionsStepImpl<PDF> lowest()
Description copied from interface:FieldSortMissingValueBehaviorStepGive documents with missing values the lowest value when sorting.This puts documents with missing values first when using ascending order, or last when using descending order.
- Specified by:
lowestin interfaceFieldSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
use
public FieldSortOptionsStepImpl<PDF> use(Object value, ValueConvert convert)
Description copied from interface:FieldSortMissingValueBehaviorStepWhen documents are missing a value on the sort field, use the given value instead.- Specified by:
usein interfaceFieldSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Parameters:
value- The value to use as a default when a document is missing a value on the sort field.convert- Controls how thevalueshould be converted before Hibernate Search attempts to interpret it as a field value. SeeValueConvert.- Returns:
- The next step.
-
build
protected SearchSort build()
- Specified by:
buildin classAbstractSortThenStep
-
-