Package org.elasticsearch.plugins
Interface AnalysisPlugin
public interface AnalysisPlugin
An additional extension point for
Plugin
s that extends Elasticsearch's analysis functionality. To add an additional
TokenFilter
just implement the interface and implement the getTokenFilters()
method:
public class AnalysisPhoneticPlugin extends Plugin implements AnalysisPlugin {
@Override
public Map<String, AnalysisProvider<TokenFilterFactory>> getTokenFilters() {
return singletonMap("phonetic", PhoneticTokenFilterFactory::new);
}
}
Elasticsearch doesn't have any automatic mechanism to share these components between indexes. If any component is heavy enough to warrant
such sharing then it is the Plugin's responsibility to do it in their AnalysisModule.AnalysisProvider
implementation. We recommend against doing
this unless absolutely necessary because it can be difficult to get the caching right given things like behavior changes across versions.-
Method Summary
Modifier and TypeMethodDescriptiondefault Map<String,AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends org.apache.lucene.analysis.Analyzer>>>
Override to add additionalAnalyzer
s.Override to add additionalCharFilter
s.Override to add additional hunspellDictionary
s.default List<PreBuiltAnalyzerProviderFactory>
Override to add additional pre-configuredAnalyzer
s.default List<PreConfiguredCharFilter>
Override to add additional pre-configuredCharFilter
s.default List<PreConfiguredTokenFilter>
Override to add additional pre-configuredTokenFilter
s.default List<PreConfiguredTokenizer>
Override to add additional pre-configuredTokenizer
.Override to add additionalTokenFilter
s.Override to add additionalTokenizer
s.static <T> AnalysisModule.AnalysisProvider<T>
requiresAnalysisSettings(AnalysisModule.AnalysisProvider<T> provider)
Mark anAnalysisModule.AnalysisProvider
as requiring the index's settings.
-
Method Details
-
getCharFilters
Override to add additionalCharFilter
s. SeerequiresAnalysisSettings(AnalysisProvider)
how to on get the configuration from the index. -
getTokenFilters
Override to add additionalTokenFilter
s. SeerequiresAnalysisSettings(AnalysisProvider)
how to on get the configuration from the index. -
getTokenizers
Override to add additionalTokenizer
s. SeerequiresAnalysisSettings(AnalysisProvider)
how to on get the configuration from the index. -
getAnalyzers
default Map<String,AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends org.apache.lucene.analysis.Analyzer>>> getAnalyzers()Override to add additionalAnalyzer
s. SeerequiresAnalysisSettings(AnalysisProvider)
how to on get the configuration from the index. -
getPreBuiltAnalyzerProviderFactories
Override to add additional pre-configuredAnalyzer
s. -
getPreConfiguredCharFilters
Override to add additional pre-configuredCharFilter
s. -
getPreConfiguredTokenFilters
Override to add additional pre-configuredTokenFilter
s. -
getPreConfiguredTokenizers
Override to add additional pre-configuredTokenizer
. -
getHunspellDictionaries
Override to add additional hunspellDictionary
s. -
requiresAnalysisSettings
static <T> AnalysisModule.AnalysisProvider<T> requiresAnalysisSettings(AnalysisModule.AnalysisProvider<T> provider)Mark anAnalysisModule.AnalysisProvider
as requiring the index's settings.
-