Package org.elasticsearch.index.analysis
Class NamedAnalyzer
- java.lang.Object
-
- org.apache.lucene.analysis.Analyzer
-
- org.apache.lucene.analysis.AnalyzerWrapper
-
- org.apache.lucene.analysis.DelegatingAnalyzerWrapper
-
- org.elasticsearch.index.analysis.NamedAnalyzer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class NamedAnalyzer extends org.apache.lucene.analysis.DelegatingAnalyzerWrapperNamed analyzer is an analyzer wrapper around an actual analyzer (analyzerthat is associated with a name (name().
-
-
Constructor Summary
Constructors Constructor Description NamedAnalyzer(java.lang.String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer)NamedAnalyzer(NamedAnalyzer analyzer, int positionIncrementGap)
-
Method Summary
Modifier and Type Method Description org.apache.lucene.analysis.Analyzeranalyzer()The actual analyzer.voidcheckAllowedInMode(AnalysisMode mode)Checks the wrapped analyzer for the provided restrictedAnalysisModeand throws an error if the analyzer is not allowed to run in that mode.voidclose()booleanequals(java.lang.Object o)AnalysisModegetAnalysisMode()Returns whether this analyzer can be updatedintgetPositionIncrementGap(java.lang.String fieldName)protected org.apache.lucene.analysis.AnalyzergetWrappedAnalyzer(java.lang.String fieldName)inthashCode()java.lang.Stringname()The name of the analyzer.AnalyzerScopescope()The scope of the analyzer.java.lang.StringtoString()-
Methods inherited from class org.apache.lucene.analysis.DelegatingAnalyzerWrapper
wrapComponents, wrapReader, wrapReaderForNormalization, wrapTokenStreamForNormalization
-
Methods inherited from class org.apache.lucene.analysis.AnalyzerWrapper
attributeFactory, createComponents, getOffsetGap, initReader, initReaderForNormalization, normalize
-
-
-
-
Constructor Detail
-
NamedAnalyzer
public NamedAnalyzer(NamedAnalyzer analyzer, int positionIncrementGap)
-
NamedAnalyzer
public NamedAnalyzer(java.lang.String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer)
-
-
Method Detail
-
name
public java.lang.String name()
The name of the analyzer.
-
scope
public AnalyzerScope scope()
The scope of the analyzer.
-
getAnalysisMode
public AnalysisMode getAnalysisMode()
Returns whether this analyzer can be updated
-
analyzer
public org.apache.lucene.analysis.Analyzer analyzer()
The actual analyzer.
-
getWrappedAnalyzer
protected org.apache.lucene.analysis.Analyzer getWrappedAnalyzer(java.lang.String fieldName)
- Specified by:
getWrappedAnalyzerin classorg.apache.lucene.analysis.AnalyzerWrapper
-
getPositionIncrementGap
public int getPositionIncrementGap(java.lang.String fieldName)
- Overrides:
getPositionIncrementGapin classorg.apache.lucene.analysis.AnalyzerWrapper
-
checkAllowedInMode
public void checkAllowedInMode(AnalysisMode mode)
Checks the wrapped analyzer for the provided restrictedAnalysisModeand throws an error if the analyzer is not allowed to run in that mode. The error contains more detailed information about the offending filters that caused the analyzer to not be allowed in this mode.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classorg.apache.lucene.analysis.Analyzer
-
-