Interface IndexManager
- All Known Subinterfaces:
ElasticsearchIndexManager
,LuceneIndexManager
public interface IndexManager
An index manager as viewed by Hibernate Search users.
This interface exposes all operations that Hibernate Search users should be able to execute directly on the index manager, without having to go through mapper-specific APIs.
-
Method Summary
Modifier and TypeMethodDescriptionList
<? extends AnalysisToken> Applies the analyzer to a given string to produce a list of tokens.CompletionStage
<List<? extends AnalysisToken>> analyzeAsync
(String analyzerName, String terms, OperationSubmitter operationSubmitter) Applies the analyzer to a given string to produce a list of tokens in an async manner.backend()
Applies the normalizer to a given string to produce a normalized token.normalizeAsync
(String normalizerName, String terms, OperationSubmitter operationSubmitter) Applies the normalizer to a given string to produce a normalized token in an async manner.<T> T
Unwrap the index manager to some implementation-specific type.
-
Method Details
-
backend
Backend backend()- Returns:
- The backend in which this index manager is defined.
-
descriptor
IndexDescriptor descriptor()- Returns:
- A descriptor of this index, exposing in particular a list of field and their characteristics.
-
analyze
Applies the analyzer to a given string to produce a list of tokens.- Parameters:
analyzerName
- The name of the configured analyzer to apply.terms
- The string to apply the analysis to.- Returns:
- The list of tokens produced by the analyzer for a given string.
-
normalize
Applies the normalizer to a given string to produce a normalized token.- Parameters:
normalizerName
- The name of the configured normalizer to apply.terms
- The string to apply the normalizer to.- Returns:
- The token produced by the normalizer for a given string.
-
analyzeAsync
@Incubating CompletionStage<List<? extends AnalysisToken>> analyzeAsync(String analyzerName, String terms, OperationSubmitter operationSubmitter) Applies the analyzer to a given string to produce a list of tokens in an async manner.- Parameters:
analyzerName
- The name of the configured analyzer to apply.terms
- The string to apply the analysis to.operationSubmitter
- How to handle request to submit operation when the queue is full.- Returns:
- A future that will ultimately provide the list of tokens produced by the analyzer for a given string.
-
normalizeAsync
@Incubating CompletionStage<AnalysisToken> normalizeAsync(String normalizerName, String terms, OperationSubmitter operationSubmitter) Applies the normalizer to a given string to produce a normalized token in an async manner.- Parameters:
normalizerName
- The name of the configured normalizer to apply.terms
- The string to apply the normalizer to.operationSubmitter
- How to handle request to submit operation when the queue is full.- Returns:
- A future that will ultimately provide the token produced by the normalizer for a given string.
-
unwrap
Unwrap the index manager to some implementation-specific type.- Type Parameters:
T
- The expected type- Parameters:
clazz
- TheClass
representing the expected type- Returns:
- The unwrapped index manager.
- Throws:
SearchException
- if the index manager implementation does not support unwrapping to the given class.
-