Package io.jmix.search.searching
Class SearchRequestScopeProvider
java.lang.Object
io.jmix.search.searching.SearchRequestScopeProvider
@Component("search_SearchRequestScopeProvider")
public class SearchRequestScopeProvider
extends Object
The class is responsible for calculating scopes used for building
search requests in the search engine. It considers permissions for the current user and attaches
additional subfields to indexed fields as needed.
This component utilizes
SearchSecurityDecorator to enforce security constraints,
IndexConfigurationManager for managing index configurations, and
SearchFieldsProvider to resolve fields of the index.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final IndexConfigurationManagerprotected final SearchFieldsProviderprotected final SearchSecurityDecorator -
Constructor Summary
ConstructorsConstructorDescriptionSearchRequestScopeProvider(SearchSecurityDecorator securityDecorator, IndexConfigurationManager indexConfigurationManager, SearchFieldsProvider searchFieldsProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<String>getEntitiesWithConfiguration(List<String> entities) getSearchRequestScope(List<String> entities, VirtualSubfieldsProvider virtualSubfieldsProvider) Generates a list ofIndexSearchRequestScopeobjects that define the scope of search requests for the specified entities.
-
Field Details
-
securityDecorator
-
indexConfigurationManager
-
searchFieldsProvider
-
-
Constructor Details
-
SearchRequestScopeProvider
public SearchRequestScopeProvider(SearchSecurityDecorator securityDecorator, IndexConfigurationManager indexConfigurationManager, SearchFieldsProvider searchFieldsProvider)
-
-
Method Details
-
getSearchRequestScope
public List<IndexSearchRequestScope> getSearchRequestScope(List<String> entities, VirtualSubfieldsProvider virtualSubfieldsProvider) Generates a list ofIndexSearchRequestScopeobjects that define the scope of search requests for the specified entities. The method evaluates the entities allowed for the current user based on security constraints and resolves the fields required for search using the providedVirtualSubfieldsProvider.- Parameters:
entities- list of entity names to evaluate for search scope. If empty, all indexed entities are considered.virtualSubfieldsProvider- provider used to resolve additional subfields for indexed fields.- Returns:
- list of
IndexSearchRequestScopeobjects representing the search scope for the specified entities, or an empty list if no valid scopes are resolved.
-
getEntitiesWithConfiguration
-