public final class AnalysisRegistry
extends java.lang.Object
implements java.io.Closeable
IndexAnalyzers
via build(IndexSettings)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INDEX_ANALYSIS_CHAR_FILTER |
static java.lang.String |
INDEX_ANALYSIS_FILTER |
static java.lang.String |
INDEX_ANALYSIS_TOKENIZER |
Constructor and Description |
---|
AnalysisRegistry(Environment environment,
java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<CharFilterFactory>> charFilters,
java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<TokenFilterFactory>> tokenFilters,
java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<TokenizerFactory>> tokenizers,
java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<AnalyzerProvider<?>>> analyzers,
java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<AnalyzerProvider<?>>> normalizers) |
Modifier and Type | Method and Description |
---|---|
IndexAnalyzers |
build(IndexSettings indexSettings)
Creates an index-level
IndexAnalyzers from this registry using the given index settings |
IndexAnalyzers |
build(IndexSettings indexSettings,
java.util.Map<java.lang.String,AnalyzerProvider<?>> analyzerProviders,
java.util.Map<java.lang.String,AnalyzerProvider<?>> normalizerProviders,
java.util.Map<java.lang.String,TokenizerFactory> tokenizerFactoryFactories,
java.util.Map<java.lang.String,CharFilterFactory> charFilterFactoryFactories,
java.util.Map<java.lang.String,TokenFilterFactory> tokenFilterFactoryFactories) |
java.util.Map<java.lang.String,AnalyzerProvider<?>> |
buildAnalyzerFactories(IndexSettings indexSettings) |
java.util.Map<java.lang.String,CharFilterFactory> |
buildCharFilterFactories(IndexSettings indexSettings) |
java.util.Map<java.lang.String,AnalyzerProvider<?>> |
buildNormalizerFactories(IndexSettings indexSettings) |
java.util.Map<java.lang.String,TokenFilterFactory> |
buildTokenFilterFactories(IndexSettings indexSettings) |
java.util.Map<java.lang.String,TokenizerFactory> |
buildTokenizerFactories(IndexSettings indexSettings) |
void |
close() |
org.apache.lucene.analysis.Analyzer |
getAnalyzer(java.lang.String analyzer)
Returns a registered
Analyzer provider by name or null if the analyzer was not registered |
AnalysisModule.AnalysisProvider<CharFilterFactory> |
getCharFilterProvider(java.lang.String charFilter)
Returns a registered
CharFilterFactory provider by name or null if the char filter was not registered |
AnalysisModule.AnalysisProvider<CharFilterFactory> |
getCharFilterProvider(java.lang.String charFilter,
IndexSettings indexSettings)
Returns a registered
CharFilterFactory provider by IndexSettings
or a registered CharFilterFactory provider by predefined name
or null if the charFilter was not registered |
static Settings |
getSettingsFromIndexSettings(IndexSettings indexSettings,
java.lang.String groupName)
|
AnalysisModule.AnalysisProvider<TokenFilterFactory> |
getTokenFilterProvider(java.lang.String tokenFilter)
Returns a registered
TokenFilterFactory provider by name or null if the token filter was not registered |
AnalysisModule.AnalysisProvider<TokenFilterFactory> |
getTokenFilterProvider(java.lang.String tokenFilter,
IndexSettings indexSettings)
Returns a registered
TokenFilterFactory provider by IndexSettings
or a registered TokenFilterFactory provider by predefined name
or null if the tokenFilter was not registered |
AnalysisModule.AnalysisProvider<TokenizerFactory> |
getTokenizerProvider(java.lang.String tokenizer)
Returns a registered
TokenizerFactory provider by name or null if the tokenizer was not registered |
AnalysisModule.AnalysisProvider<TokenizerFactory> |
getTokenizerProvider(java.lang.String tokenizer,
IndexSettings indexSettings)
Returns a registered
TokenizerFactory provider by IndexSettings
or a registered TokenizerFactory provider by predefined name
or null if the tokenizer was not registered |
public static final java.lang.String INDEX_ANALYSIS_CHAR_FILTER
public static final java.lang.String INDEX_ANALYSIS_FILTER
public static final java.lang.String INDEX_ANALYSIS_TOKENIZER
public AnalysisRegistry(Environment environment, java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<CharFilterFactory>> charFilters, java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<TokenFilterFactory>> tokenFilters, java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<TokenizerFactory>> tokenizers, java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<AnalyzerProvider<?>>> analyzers, java.util.Map<java.lang.String,AnalysisModule.AnalysisProvider<AnalyzerProvider<?>>> normalizers)
public static Settings getSettingsFromIndexSettings(IndexSettings indexSettings, java.lang.String groupName)
indexSettings
- an index settingsgroupName
- tokenizer/token filter/char filter nameSettings
public AnalysisModule.AnalysisProvider<TokenizerFactory> getTokenizerProvider(java.lang.String tokenizer)
TokenizerFactory
provider by name or null
if the tokenizer was not registeredpublic AnalysisModule.AnalysisProvider<TokenFilterFactory> getTokenFilterProvider(java.lang.String tokenFilter)
TokenFilterFactory
provider by name or null
if the token filter was not registeredpublic AnalysisModule.AnalysisProvider<CharFilterFactory> getCharFilterProvider(java.lang.String charFilter)
CharFilterFactory
provider by name or null
if the char filter was not registeredpublic org.apache.lucene.analysis.Analyzer getAnalyzer(java.lang.String analyzer) throws java.io.IOException
Analyzer
provider by name or null
if the analyzer was not registeredjava.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public IndexAnalyzers build(IndexSettings indexSettings) throws java.io.IOException
IndexAnalyzers
from this registry using the given index settingsjava.io.IOException
public java.util.Map<java.lang.String,TokenFilterFactory> buildTokenFilterFactories(IndexSettings indexSettings) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,TokenizerFactory> buildTokenizerFactories(IndexSettings indexSettings) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,CharFilterFactory> buildCharFilterFactories(IndexSettings indexSettings) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,AnalyzerProvider<?>> buildAnalyzerFactories(IndexSettings indexSettings) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,AnalyzerProvider<?>> buildNormalizerFactories(IndexSettings indexSettings) throws java.io.IOException
java.io.IOException
public AnalysisModule.AnalysisProvider<TokenizerFactory> getTokenizerProvider(java.lang.String tokenizer, IndexSettings indexSettings)
TokenizerFactory
provider by IndexSettings
or a registered TokenizerFactory
provider by predefined name
or null
if the tokenizer was not registeredtokenizer
- global or defined tokenizer nameindexSettings
- an index settingsTokenizerFactory
provider or null
public AnalysisModule.AnalysisProvider<TokenFilterFactory> getTokenFilterProvider(java.lang.String tokenFilter, IndexSettings indexSettings)
TokenFilterFactory
provider by IndexSettings
or a registered TokenFilterFactory
provider by predefined name
or null
if the tokenFilter was not registeredtokenFilter
- global or defined tokenFilter nameindexSettings
- an index settingsTokenFilterFactory
provider or null
public AnalysisModule.AnalysisProvider<CharFilterFactory> getCharFilterProvider(java.lang.String charFilter, IndexSettings indexSettings)
CharFilterFactory
provider by IndexSettings
or a registered CharFilterFactory
provider by predefined name
or null
if the charFilter was not registeredcharFilter
- global or defined charFilter nameindexSettings
- an index settingsCharFilterFactory
provider or null
public IndexAnalyzers build(IndexSettings indexSettings, java.util.Map<java.lang.String,AnalyzerProvider<?>> analyzerProviders, java.util.Map<java.lang.String,AnalyzerProvider<?>> normalizerProviders, java.util.Map<java.lang.String,TokenizerFactory> tokenizerFactoryFactories, java.util.Map<java.lang.String,CharFilterFactory> charFilterFactoryFactories, java.util.Map<java.lang.String,TokenFilterFactory> tokenFilterFactoryFactories)