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 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

      @Incubating List<? extends AnalysisToken> analyze(String analyzerName, String terms)
      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

      @Incubating AnalysisToken normalize(String normalizerName, String terms)
      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

      <T> T unwrap(Class<T> clazz)
      Unwrap the index manager to some implementation-specific type.
      Type Parameters:
      T - The expected type
      Parameters:
      clazz - The Class representing the expected type
      Returns:
      The unwrapped index manager.
      Throws:
      SearchException - if the index manager implementation does not support unwrapping to the given class.