Interface TypedSearchScope<SR,E>
- Type Parameters:
E
- A supertype of all types in this scope.
- All Superinterfaces:
SearchScope<E>
The scope can be used for search, to build search-related objects (predicate, sort, projection, aggregation, ...),
or to define the targeted entities/indexes
when passing it to the session
.
It can also be used to start large-scale operations, e.g. using a SearchScope.schemaManager()
, a SearchScope.workspace()
or a SearchScope.massIndexer()
.
-
Method Summary
Modifier and TypeMethodDescriptionInitiate the building of a search aggregation that will be valid for the indexes in this scope.<T> T
extension
(IndexScopeExtension<T> extension) Extend the current search scope with the given extension, resulting in an extended search scope offering backend-specific utilities.Initiate the building of a search predicate.Initiate the building of a search projection that will be valid for the indexes in this scope.sort()
Initiate the building of a search sort.Methods inherited from interface org.hibernate.search.mapper.orm.scope.SearchScope
highlighter, includedTypes, massIndexer, massIndexer, massIndexer, massIndexer, schemaManager, workspace, workspace, workspace
-
Method Details
-
predicate
TypedSearchPredicateFactory<SR> 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.- Specified by:
predicate
in interfaceSearchScope<SR>
- Returns:
- A predicate factory.
- See Also:
-
sort
TypedSearchSortFactory<SR> 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. or a wider scope.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.- Specified by:
sort
in interfaceSearchScope<SR>
- Returns:
- A sort factory.
- See Also:
-
projection
TypedSearchProjectionFactory<SR,EntityReference, projection()E> 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.select(Function)
define projections with lambdas} within the search query DSL, removing the need to create separate objects to represent the projections.- Specified by:
projection
in interfaceSearchScope<SR>
- Returns:
- A projection factory.
- See Also:
-
aggregation
TypedSearchAggregationFactory<SR> 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.- Specified by:
aggregation
in interfaceSearchScope<SR>
- Returns:
- An aggregation factory.
- See Also:
-
extension
Extend the current search scope with the given extension, resulting in an extended search scope offering backend-specific utilities.- Specified by:
extension
in interfaceSearchScope<SR>
- Type Parameters:
T
- The type of search scope provided by the extension.- Parameters:
extension
- The extension to apply.- Returns:
- The extended search scope.
- Throws:
SearchException
- If the extension cannot be applied (wrong underlying technology, ...).
-