Class ElasticsearchSearchStrategyProvider
java.lang.Object
io.jmix.searchelasticsearch.searching.strategy.ElasticsearchSearchStrategyProvider
- All Implemented Interfaces:
SearchStrategyProvider<ElasticsearchSearchStrategy>
public class ElasticsearchSearchStrategyProvider
extends Object
implements SearchStrategyProvider<ElasticsearchSearchStrategy>
Provides Elasticsearch search strategies
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
protected final IndexConfigurationManager
protected final Map<String,
ElasticsearchSearchStrategy> -
Constructor Summary
ConstructorDescriptionElasticsearchSearchStrategyProvider
(IndexConfigurationManager indexConfigurationManager, Collection<ElasticsearchSearchStrategy> searchStrategies, SearchProperties applicationProperties) -
Method Summary
Modifier and TypeMethodDescriptionfindSearchStrategyByName
(String strategyName) Returns aElasticsearchSearchStrategy
by provided name.Returns all registered search strategies.Gets default search strategy.getSearchStrategyByName
(String strategyName) GetsElasticsearchSearchStrategy
by provided name.protected boolean
isSupported
(ElasticsearchSearchStrategy searchStrategy)
-
Field Details
-
indexConfigurationManager
-
registry
-
defaultStrategyName
-
-
Constructor Details
-
ElasticsearchSearchStrategyProvider
public ElasticsearchSearchStrategyProvider(IndexConfigurationManager indexConfigurationManager, Collection<ElasticsearchSearchStrategy> searchStrategies, SearchProperties applicationProperties)
-
-
Method Details
-
getSearchStrategyByName
GetsElasticsearchSearchStrategy
by provided name. Throws exception if there is no strategy with such name.- Specified by:
getSearchStrategyByName
in interfaceSearchStrategyProvider<ElasticsearchSearchStrategy>
- Parameters:
strategyName
- strategy name- Returns:
ElasticsearchSearchStrategy
- Throws:
IllegalStateException
- if strategy with provided name not found
-
getDefaultSearchStrategy
Gets default search strategy.- Specified by:
getDefaultSearchStrategy
in interfaceSearchStrategyProvider<ElasticsearchSearchStrategy>
- Returns:
ElasticsearchSearchStrategy
-
getAllSearchStrategies
Returns all registered search strategies.- Specified by:
getAllSearchStrategies
in interfaceSearchStrategyProvider<ElasticsearchSearchStrategy>
- Returns:
- all
ElasticsearchSearchStrategy
-
findSearchStrategyByName
Returns aElasticsearchSearchStrategy
by provided name. Returns null if there is no strategy with such name.- Specified by:
findSearchStrategyByName
in interfaceSearchStrategyProvider<ElasticsearchSearchStrategy>
- Parameters:
strategyName
- strategy name- Returns:
ElasticsearchSearchStrategy
or null if no strategy was found
-
isSupported
-