Package org.elasticsearch.index.analysis
Class IndexAnalyzers
java.lang.Object
org.elasticsearch.index.analysis.IndexAnalyzers
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class IndexAnalyzers
extends java.lang.Object
implements java.io.Closeable
IndexAnalyzers contains a name to analyzer mapping for a specific index.
This class only holds analyzers that are explicitly configured for an index and doesn't allow
access to individual tokenizers, char or token filter.
- See Also:
AnalysisRegistry
-
Constructor Summary
Constructors Constructor Description IndexAnalyzers(java.util.Map<java.lang.String,NamedAnalyzer> analyzers, java.util.Map<java.lang.String,NamedAnalyzer> normalizers, java.util.Map<java.lang.String,NamedAnalyzer> whitespaceNormalizers) -
Method Summary
Modifier and Type Method Description voidclose()NamedAnalyzerget(java.lang.String name)Returns an analyzer mapped to the given name ornullif not presentjava.util.Map<java.lang.String,NamedAnalyzer>getAnalyzers()Returns an (unmodifiable) map of containing the index analyzersNamedAnalyzergetDefaultIndexAnalyzer()Returns the default index analyzer for this indexNamedAnalyzergetDefaultSearchAnalyzer()Returns the default search analyzer for this index.NamedAnalyzergetDefaultSearchQuoteAnalyzer()Returns the default search quote analyzer for this indexNamedAnalyzergetNormalizer(java.lang.String name)Returns a normalizer mapped to the given name ornullif not presentNamedAnalyzergetWhitespaceNormalizer(java.lang.String name)Returns a normalizer that splits on whitespace mapped to the given name ornullif not present
-
Constructor Details
-
IndexAnalyzers
public IndexAnalyzers(java.util.Map<java.lang.String,NamedAnalyzer> analyzers, java.util.Map<java.lang.String,NamedAnalyzer> normalizers, java.util.Map<java.lang.String,NamedAnalyzer> whitespaceNormalizers)
-
-
Method Details
-
get
Returns an analyzer mapped to the given name ornullif not present -
getAnalyzers
Returns an (unmodifiable) map of containing the index analyzers -
getNormalizer
Returns a normalizer mapped to the given name ornullif not present -
getWhitespaceNormalizer
Returns a normalizer that splits on whitespace mapped to the given name ornullif not present -
getDefaultIndexAnalyzer
Returns the default index analyzer for this index -
getDefaultSearchAnalyzer
Returns the default search analyzer for this index. If not set, this will return the default analyzer -
getDefaultSearchQuoteAnalyzer
Returns the default search quote analyzer for this index -
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-