Interface SearchScope<E>
-
- Type Parameters:
E
- A supertype of all types in this scope.
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SearchAggregationFactory
aggregation()
Initiate the building of a search aggregation that will be valid for the indexes in this scope.Set<? extends SearchIndexedEntity<? extends E>>
includedTypes()
MassIndexer
massIndexer()
Create aMassIndexer
for the indexes mapped to types in this scope, or to any of their sub-types.MassIndexer
massIndexer(String tenantId)
Create aMassIndexer
for the indexes mapped to types in this scope, or to any of their sub-types.SearchPredicateFactory
predicate()
Initiate the building of a search predicate.SearchProjectionFactory<EntityReference,E>
projection()
Initiate the building of a search projection that will be valid for the indexes in this scope.SearchSchemaManager
schemaManager()
Create aSearchSchemaManager
for the indexes mapped to types in this scope, or to any of their sub-types.SearchSortFactory
sort()
Initiate the building of a search sort.SearchWorkspace
workspace()
Create aSearchWorkspace
for the indexes mapped to types in this scope, or to any of their sub-types.SearchWorkspace
workspace(String tenantId)
Create aSearchWorkspace
for the indexes mapped to types in this scope, or to any of their sub-types.
-
-
-
Method Detail
-
predicate
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
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. 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.- Returns:
- A sort factory.
- See Also:
SearchSortFactory
-
projection
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.select(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
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
-
schemaManager
SearchSchemaManager schemaManager()
Create aSearchSchemaManager
for the indexes mapped to types in this scope, or to any of their sub-types.- Returns:
- A
SearchSchemaManager
.
-
workspace
SearchWorkspace workspace()
Create aSearchWorkspace
for the indexes mapped to types in this scope, or to any of their sub-types.This method only works for single-tenant applications. If multi-tenancy is enabled, use
workspace(String)
instead.- Returns:
- A
SearchWorkspace
.
-
workspace
SearchWorkspace workspace(String tenantId)
Create aSearchWorkspace
for the indexes mapped to types in this scope, or to any of their sub-types.This method only works for multi-tenant applications. If multi-tenancy is disabled, use
workspace()
instead.- Parameters:
tenantId
- The identifier of the tenant whose index content should be targeted.- Returns:
- A
SearchWorkspace
.
-
massIndexer
MassIndexer massIndexer()
Create aMassIndexer
for the indexes mapped to types in this scope, or to any of their sub-types.This method only works for single-tenant applications. If multi-tenancy is enabled, use
massIndexer(String)
instead.MassIndexer
instances cannot be reused.- Returns:
- A
MassIndexer
.
-
massIndexer
MassIndexer massIndexer(String tenantId)
Create aMassIndexer
for the indexes mapped to types in this scope, or to any of their sub-types.This method only works for multi-tenant applications. If multi-tenancy is disabled, use
massIndexer()
instead.MassIndexer
instances cannot be reused.- Parameters:
tenantId
- The identifier of the tenant whose index content should be targeted.- Returns:
- A
MassIndexer
.
-
includedTypes
Set<? extends SearchIndexedEntity<? extends E>> includedTypes()
- Returns:
- A set containing one
SearchIndexedEntity
for each indexed entity in this scope.
-
-