Class DistanceSortOptionsStepImpl<PDF extends SearchPredicateFactory>
- java.lang.Object
-
- org.hibernate.search.engine.search.sort.dsl.spi.AbstractSortThenStep
-
- org.hibernate.search.engine.search.sort.dsl.impl.DistanceSortOptionsStepImpl<PDF>
-
- All Implemented Interfaces:
DistanceSortMissingValueBehaviorStep<DistanceSortOptionsStepImpl<PDF>>,DistanceSortOptionsStep<DistanceSortOptionsStepImpl<PDF>,PDF>,SortFilterStep<DistanceSortOptionsStepImpl<PDF>,PDF>,SortFinalStep,SortModeStep<DistanceSortOptionsStepImpl<PDF>>,SortOrderStep<DistanceSortOptionsStepImpl<PDF>>,SortThenStep
public class DistanceSortOptionsStepImpl<PDF extends SearchPredicateFactory> extends AbstractSortThenStep implements DistanceSortOptionsStep<DistanceSortOptionsStepImpl<PDF>,PDF>, DistanceSortMissingValueBehaviorStep<DistanceSortOptionsStepImpl<PDF>>
-
-
Constructor Summary
Constructors Constructor Description DistanceSortOptionsStepImpl(SearchSortDslContext<?,? extends PDF> dslContext, String fieldPath, GeoPoint center)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SearchSortbuild()DistanceSortOptionsStepImpl<PDF>filter(Function<? super PDF,? extends PredicateFinalStep> clauseContributor)Filter nested objects from which values will be extracted for this sort.DistanceSortOptionsStepImpl<PDF>filter(SearchPredicate searchPredicate)Filter nested objects from which values will be extracted for this sort.DistanceSortOptionsStepImpl<PDF>first()Put documents with missing values first in the sorting.DistanceSortOptionsStepImpl<PDF>highest()Give documents with missing values the highest value when sorting.DistanceSortOptionsStepImpl<PDF>last()Put documents with missing values last in the sorting.DistanceSortOptionsStepImpl<PDF>lowest()Give documents with missing values the lowest value when sorting.DistanceSortMissingValueBehaviorStep<DistanceSortOptionsStepImpl<PDF>>missing()Start describing the behavior of this sort when a document doesn't have any value for the targeted field.DistanceSortOptionsStepImpl<PDF>mode(SortMode mode)Start describing the behavior of this sort when a document has multiple values for the targeted field.DistanceSortOptionsStepImpl<PDF>order(SortOrder order)Sort in the given order.DistanceSortOptionsStepImpl<PDF>use(GeoPoint value)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.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
-
DistanceSortOptionsStepImpl
public DistanceSortOptionsStepImpl(SearchSortDslContext<?,? extends PDF> dslContext, String fieldPath, GeoPoint center)
-
-
Method Detail
-
order
public DistanceSortOptionsStepImpl<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 DistanceSortOptionsStepImpl<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.
-
filter
public DistanceSortOptionsStepImpl<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<DistanceSortOptionsStepImpl<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 DistanceSortOptionsStepImpl<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<DistanceSortOptionsStepImpl<PDF extends SearchPredicateFactory>,PDF extends SearchPredicateFactory>- Parameters:
searchPredicate- The predicate that must match.- Returns:
this, for method chaining.
-
missing
public DistanceSortMissingValueBehaviorStep<DistanceSortOptionsStepImpl<PDF>> missing()
Description copied from interface:DistanceSortOptionsStepStart describing the behavior of this sort when a document doesn't have any value for the targeted field.- Specified by:
missingin interfaceDistanceSortOptionsStep<DistanceSortOptionsStepImpl<PDF extends SearchPredicateFactory>,PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
first
public DistanceSortOptionsStepImpl<PDF> first()
Description copied from interface:DistanceSortMissingValueBehaviorStepPut documents with missing values first in the sorting.This instruction is independent of whether the sort is being ascending or descending.
- Specified by:
firstin interfaceDistanceSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
last
public DistanceSortOptionsStepImpl<PDF> last()
Description copied from interface:DistanceSortMissingValueBehaviorStepPut documents with missing values last in the sorting.This instruction is independent of whether the sort is being ascending or descending.
- Specified by:
lastin interfaceDistanceSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
highest
public DistanceSortOptionsStepImpl<PDF> highest()
Description copied from interface:DistanceSortMissingValueBehaviorStepGive 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 interfaceDistanceSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
lowest
public DistanceSortOptionsStepImpl<PDF> lowest()
Description copied from interface:DistanceSortMissingValueBehaviorStepGive 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 interfaceDistanceSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Returns:
- The next step.
-
use
public DistanceSortOptionsStepImpl<PDF> use(GeoPoint value)
Description copied from interface:DistanceSortMissingValueBehaviorStepWhen documents are missing a value on the sort field, use the given value instead.- Specified by:
usein interfaceDistanceSortMissingValueBehaviorStep<PDF extends SearchPredicateFactory>- Parameters:
value- The value to use as a default when a document is missing a value on the sort field.- Returns:
- The next step.
-
build
protected SearchSort build()
- Specified by:
buildin classAbstractSortThenStep
-
-