Interface AnalysisModule.AnalysisProvider<T>

All Known Implementing Classes:
PreBuiltAnalyzerProviderFactory, PreConfiguredAnalysisComponent, PreConfiguredCharFilter, PreConfiguredTokenFilter, PreConfiguredTokenizer
Enclosing class:
AnalysisModule

public static interface AnalysisModule.AnalysisProvider<T>
The basic factory interface for analysis components.
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    get(Environment environment, String name)
    Creates a new global scope analysis provider without index specific settings not settings for the provider itself.
    get(IndexSettings indexSettings, Environment environment, String name, Settings settings)
    Creates a new analysis provider.
    default boolean
    If true the analysis component created by this provider requires certain settings to be instantiated.
  • Method Details

    • get

      T get(IndexSettings indexSettings, Environment environment, String name, Settings settings) throws IOException
      Creates a new analysis provider.
      Parameters:
      indexSettings - the index settings for the index this provider is created for
      environment - the nodes environment to load resources from persistent storage
      name - the name of the analysis component
      settings - the component specific settings without context prefixes
      Returns:
      a new provider instance
      Throws:
      IOException - if an IOException occurs
    • get

      default T get(Environment environment, String name) throws IOException
      Creates a new global scope analysis provider without index specific settings not settings for the provider itself. This can be used to get a default instance of an analysis factory without binding to an index.
      Parameters:
      environment - the nodes environment to load resources from persistent storage
      name - the name of the analysis component
      Returns:
      a new provider instance
      Throws:
      IOException - if an IOException occurs
      IllegalArgumentException - if the provider requires analysis settings ie. if requiresAnalysisSettings() returns true
    • requiresAnalysisSettings

      default boolean requiresAnalysisSettings()
      If true the analysis component created by this provider requires certain settings to be instantiated. it can't be created with defaults. The default is false.