Class SearchSortDslContext<SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory>

java.lang.Object
org.hibernate.search.engine.search.sort.dsl.spi.SearchSortDslContext<SC,PDF>
Type Parameters:
SC - The type of the backend-specific search scope.
PDF - The type of factory used to create predicates in SortFilterStep.filter(Function).

public final class SearchSortDslContext<SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory> extends Object
Represents the current context in the search DSL, including in particular the search scope, the sort builder factory and the knowledge of previous sorts chained using SortThenStep.then().
  • Method Details

    • root

      public static <SC extends SearchSortIndexScope<?>, PDF extends SearchPredicateFactory> SearchSortDslContext<SC,PDF> root(SC scope, Function<SearchSortDslContext<SC,PDF>,SearchSortFactory> factoryProvider, PDF predicateFactory)
    • scope

      public SC scope()
      Returns:
      The search scope.
    • then

      public SearchSortFactory then()
      Returns:
      A new factory to be returned by SortThenStep.then().
    • rescope

      public SearchSortDslContext<SC,PDF> rescope(SC newScope, PDF newPredicateFactory)
      Parameters:
      newScope - The new scope for the new DSL context.
      newPredicateFactory - The new predicate factory for the new DSL context.
      Returns:
      A copy of this DSL context with its scope and predicate factory replaced with the given ones.
    • append

      public SearchSortDslContext<SC,PDF> append(SearchSort sort)
      Create a new context with a sort appended.
      Parameters:
      sort - The sort to add.
      Returns:
      A new DSL context, with the given builder appended.
    • predicateFactory

      public PDF predicateFactory()
      Returns:
      The predicate factory. Will always return the exact same instance.
    • toSort

      public SearchSort toSort()
      Create a SearchSort instance matching the definition given in the previous DSL steps.
      Returns:
      The SearchSort instance.