Interface SearchScope<E>

Type Parameters:
E - A supertype of all types in this scope.
All Known Implementing Classes:
SearchScopeImpl

public interface SearchScope<E>
Represents a set of types and the corresponding indexes, allowing to build search-related objects (query, predicate, ...) taking into account the relevant indexes and their metadata (underlying technology, field types, ...).
  • Method Summary

    Modifier and Type
    Method
    Description
    org.hibernate.search.engine.search.aggregation.dsl.SearchAggregationFactory
    Initiate the building of a search aggregation that will be valid for the indexes in this scope.
    org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory
    Initiate the building of a search predicate.
    org.hibernate.search.engine.search.projection.dsl.SearchProjectionFactory<EntityReference,E>
    Initiate the building of a search projection that will be valid for the indexes in this scope.
    org.hibernate.search.engine.search.sort.dsl.SearchSortFactory
    Initiate the building of a search sort.
    Create a SearchWorkspace for the indexes mapped to types in this scope, or to any of their sub-types.
  • Method Details

    • predicate

      org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory predicate()
      Initiate the building of a search predicate.

      The predicate will only be valid for search queries created using this scope or another scope instance targeting the same indexes.

      Note this method is only necessary if you do not want to use lambda expressions, since you can define predicates with lambdas within the search query DSL, removing the need to create separate objects to represent the predicates.

      Returns:
      A predicate factory.
      See Also:
      • SearchPredicateFactory
    • sort

      org.hibernate.search.engine.search.sort.dsl.SearchSortFactory sort()
      Initiate the building of a search sort.

      The sort will only be valid for search queries created using this scope or another scope instance targeting the same indexes.

      Note this method is only necessary if you do not want to use lambda expressions, since you can define sorts with lambdas within the search query DSL, removing the need to create separate objects to represent the sorts.

      Returns:
      A sort factory.
      See Also:
      • SearchSortFactory
    • projection

      org.hibernate.search.engine.search.projection.dsl.SearchProjectionFactory<EntityReference,E> projection()
      Initiate the building of a search projection that will be valid for the indexes in this scope.

      The projection will only be valid for search queries created using this scope or another scope instance targeting the same indexes.

      Note this method is only necessary if you do not want to use lambda expressions, since you can SearchQuerySelectStep#asProjection(Function) define projections with lambdas} within the search query DSL, removing the need to create separate objects to represent the projections.

      Returns:
      A projection factory.
      See Also:
      • SearchProjectionFactory
    • aggregation

      org.hibernate.search.engine.search.aggregation.dsl.SearchAggregationFactory aggregation()
      Initiate the building of a search aggregation that will be valid for the indexes in this scope.

      The aggregation will only be usable in search queries created using this scope or another scope instance targeting the same indexes.

      Note this method is only necessary if you do not want to use lambda expressions, since you can SearchQueryOptionsStep.aggregation(AggregationKey, SearchAggregation) define aggregations with lambdas} within the search query DSL, removing the need to create separate objects to represent the aggregation.

      Returns:
      An aggregation factory.
      See Also:
      • SearchAggregationFactory
    • workspace

      SearchWorkspace workspace()
      Create a SearchWorkspace for the indexes mapped to types in this scope, or to any of their sub-types.
      Returns:
      A SearchWorkspace.