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
ConstructorsConstructorDescriptionFieldSortOptionsStepImpl(SearchSortDslContext<?, ? extends PDF> dslContext, String fieldPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected SearchSortbuild()filter(Function<? super PDF, ? extends PredicateFinalStep> clauseContributor) Filter nested objects from which values will be extracted for this sort.filter(SearchPredicate searchPredicate) Filter nested objects from which values will be extracted for this sort.first()Put documents with missing values first in the sorting.highest()Give documents with missing values the highest value when sorting.last()Put documents with missing values last in the sorting.lowest()Give documents with missing values the lowest value when sorting.missing()Start describing the behavior of this sort when a document doesn't have any value for the targeted field.Start describing the behavior of this sort when a document has multiple values for the targeted field.Sort in the given order.use(Object value, ValueModel valueModel) 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, toSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.engine.search.sort.dsl.FieldSortMissingValueBehaviorStep
use, useMethods inherited from interface org.hibernate.search.engine.search.sort.dsl.SortFilterStep
filterMethods inherited from interface org.hibernate.search.engine.search.sort.dsl.SortFinalStep
toSortMethods inherited from interface org.hibernate.search.engine.search.sort.dsl.SortOrderStep
asc, descMethods inherited from interface org.hibernate.search.engine.search.sort.dsl.SortThenStep
then
-
Constructor Details
-
FieldSortOptionsStepImpl
-
-
Method Details
-
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
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
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
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
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
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
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
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
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.valueModel- The model value, determines how thevalueshould be converted before Hibernate Search attempts to interpret it as a field value. SeeValueModel.- Returns:
- The next step.
-
build
- Specified by:
buildin classAbstractSortThenStep
-