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
ConstructorsConstructorDescriptionDistanceSortOptionsStepImpl(SearchSortDslContext<?, ? extends PDF> dslContext, String fieldPath, GeoPoint center) -
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.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.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
-
DistanceSortOptionsStepImpl
public DistanceSortOptionsStepImpl(SearchSortDslContext<?, ? extends PDF> dslContext, String fieldPath, GeoPoint center)
-
-
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.
-
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
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
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
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
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
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
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
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
- Specified by:
buildin classAbstractSortThenStep
-