Class SearchScopeImpl<E>
- All Implemented Interfaces:
SearchScope<E>,BatchScopeContext<E>
-
Constructor Summary
ConstructorsConstructorDescriptionSearchScopeImpl(HibernateOrmScopeMappingContext mappingContext, TenancyConfiguration tenancyConfiguration, PojoScopeDelegate<EntityReference, E, SearchIndexedEntity<? extends E>> delegate) -
Method Summary
Modifier and TypeMethodDescriptionInitiate the building of a search aggregation that will be valid for the indexes in this scope.<T> Textension(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 highlighter that will be valid for the indexes in this scope.Set<? extends SearchIndexedEntity<? extends E>>Create aMassIndexerfor the indexes mapped to types in this scope, or to any of their sub-types.massIndexer(Object tenantId) Create aMassIndexerfor the indexes mapped to types in this scope, or to any of their sub-types.massIndexer(String tenantId) Create aMassIndexerfor the indexes mapped to types in this scope, or to any of their sub-types.massIndexer(Set<?> tenantIds) Create aMassIndexerfor the indexes mapped to types in this scope, or to any of their sub-types.pojoWorkspace(String tenantId) Initiate the building of a search predicate.Initiate the building of a search projection that will be valid for the indexes in this scope.Create aSearchSchemaManagerfor the indexes mapped to types in this scope, or to any of their sub-types.search(HibernateOrmScopeSessionContext sessionContext, HibernateOrmSelectionLoadingContext.Builder loadingContextBuilder) sort()Initiate the building of a search sort.Create aSearchWorkspacefor the indexes mapped to types in this scope, or to any of their sub-types.Create aSearchWorkspacefor the indexes mapped to types in this scope, or to any of their sub-types.Create aSearchWorkspacefor the indexes mapped to types in this scope, or to any of their sub-types.
-
Constructor Details
-
SearchScopeImpl
public SearchScopeImpl(HibernateOrmScopeMappingContext mappingContext, TenancyConfiguration tenancyConfiguration, PojoScopeDelegate<EntityReference, E, SearchIndexedEntity<? extends E>> delegate)
-
-
Method Details
-
search
public SearchQuerySelectStep<?,EntityReference, searchE, SearchLoadingOptionsStep, ?, ?> (HibernateOrmScopeSessionContext sessionContext, HibernateOrmSelectionLoadingContext.Builder loadingContextBuilder) -
predicate
Description copied from interface:SearchScopeInitiate the building of a search predicate.The predicate will only be valid for
search queriescreated 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 lambdaswithin the search query DSL, removing the need to create separate objects to represent the predicates.- Specified by:
predicatein interfaceSearchScope<E>- Returns:
- A predicate factory.
- See Also:
-
sort
Description copied from interface:SearchScopeInitiate the building of a search sort.The sort will only be valid for
search queriescreated 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 lambdaswithin the search query DSL, removing the need to create separate objects to represent the sorts.- Specified by:
sortin interfaceSearchScope<E>- Returns:
- A sort factory.
- See Also:
-
projection
Description copied from interface:SearchScopeInitiate the building of a search projection that will be valid for the indexes in this scope.The projection will only be valid for
search queriescreated 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:
projectionin interfaceSearchScope<E>- Returns:
- A projection factory.
- See Also:
-
aggregation
Description copied from interface:SearchScopeInitiate the building of a search aggregation that will be valid for the indexes in this scope.The aggregation will only be usable in
search queriescreated 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:
aggregationin interfaceSearchScope<E>- Returns:
- An aggregation factory.
- See Also:
-
highlighter
Description copied from interface:SearchScopeInitiate the building of a highlighter that will be valid for the indexes in this scope.The highlighter will only be valid for
search queriescreated 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 highlighters with lambdaswithin the search query DSL, removing the need to create separate objects to represent the projections.- Specified by:
highlighterin interfaceSearchScope<E>- Returns:
- A highlighter factory.
-
schemaManager
Description copied from interface:SearchScopeCreate aSearchSchemaManagerfor the indexes mapped to types in this scope, or to any of their sub-types.- Specified by:
schemaManagerin interfaceSearchScope<E>- Returns:
- A
SearchSchemaManager.
-
workspace
Description copied from interface:SearchScopeCreate aSearchWorkspacefor 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
SearchScope.workspace(String)instead.- Specified by:
workspacein interfaceSearchScope<E>- Returns:
- A
SearchWorkspace.
-
workspace
Description copied from interface:SearchScopeCreate aSearchWorkspacefor 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
SearchScope.workspace()instead.- Specified by:
workspacein interfaceSearchScope<E>- Parameters:
tenantId- The identifier of the tenant whose index content should be targeted.- Returns:
- A
SearchWorkspace.
-
workspace
Description copied from interface:SearchScopeCreate aSearchWorkspacefor 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
SearchScope.workspace()instead.- Specified by:
workspacein interfaceSearchScope<E>- Parameters:
tenantId- The identifier of the tenant whose index content should be targeted.- Returns:
- A
SearchWorkspace.
-
pojoWorkspace
- Specified by:
pojoWorkspacein interfaceBatchScopeContext<E>
-
massIndexer
Description copied from interface:SearchScopeCreate aMassIndexerfor the indexes mapped to types in this scope, or to any of their sub-types.This method primarily is intended for single-tenant applications. If multi-tenancy is enabled, consider using
SearchScope.massIndexer(String)/SearchScope.massIndexer(Set)instead. In case this method is used in multi-tenant environment -MassIndexerfor all configured tenants will be created.MassIndexerinstances cannot be reused.- Specified by:
massIndexerin interfaceSearchScope<E>- Returns:
- A
MassIndexer.
-
massIndexer
Description copied from interface:SearchScopeCreate aMassIndexerfor 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
SearchScope.massIndexer()instead.MassIndexerinstances cannot be reused.- Specified by:
massIndexerin interfaceSearchScope<E>- Parameters:
tenantId- The identifier of the tenant whose index content should be targeted.- Returns:
- A
MassIndexer.
-
massIndexer
Description copied from interface:SearchScopeCreate aMassIndexerfor 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
SearchScope.massIndexer()instead.MassIndexerinstances cannot be reused.- Specified by:
massIndexerin interfaceSearchScope<E>- Parameters:
tenantId- The identifier of the tenant whose index content should be targeted.- Returns:
- A
MassIndexer.
-
massIndexer
Description copied from interface:SearchScopeCreate aMassIndexerfor the indexes mapped to types in this scope, or to any of their sub-types.This method works for both single- and multi-tenant applications. If multi-tenancy is disabled, simply keep the set of tenants empty.
MassIndexerinstances cannot be reused.- Specified by:
massIndexerin interfaceSearchScope<E>- Parameters:
tenantIds- The tenants identifiers whose index content should be targeted. If empty, all tenants will be targeted.- Returns:
- A
MassIndexer.
-
includedTypes
- Specified by:
includedTypesin interfaceSearchScope<E>- Returns:
- A set containing one
SearchIndexedEntityfor each indexed entity in this scope.
-
extension
Description copied from interface:SearchScopeExtend the current search scope with the given extension, resulting in an extended search scope offering backend-specific utilities.- Specified by:
extensionin interfaceSearchScope<E>- Type Parameters:
T- The type of search scope provided by the extension.- Parameters:
extension- The extension to apply.- Returns:
- The extended search scope.
-
schemaManagerDelegate
-