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:
Closeable,AutoCloseable
public class NamedAnalyzer
extends org.apache.lucene.analysis.DelegatingAnalyzerWrapper
Named analyzer is an analyzer wrapper around an actual analyzer (
analyzer that is associated
with a name (name().-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents -
Field Summary
Fields inherited from class org.apache.lucene.analysis.Analyzer
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY -
Constructor Summary
ConstructorsConstructorDescriptionNamedAnalyzer(String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer)NamedAnalyzer(String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer, int positionIncrementGap)NamedAnalyzer(NamedAnalyzer analyzer, int positionIncrementGap) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.analysis.Analyzeranalyzer()The actual analyzer.voidChecks the wrapped analyzer for the provided restrictedAnalysisModeand throws an error if the analyzer is not allowed to run in that mode.voidclose()booleanbooleanReturns whether this analyzer can be updatedintgetPositionIncrementGap(String fieldName)protected org.apache.lucene.analysis.AnalyzergetWrappedAnalyzer(String fieldName)inthashCode()name()The name of the analyzer.scope()The scope of the analyzer.toString()Methods inherited from class org.apache.lucene.analysis.DelegatingAnalyzerWrapper
wrapComponents, wrapReader, wrapReaderForNormalization, wrapTokenStreamForNormalizationMethods inherited from class org.apache.lucene.analysis.AnalyzerWrapper
attributeFactory, createComponents, getOffsetGap, initReader, initReaderForNormalization, normalizeMethods inherited from class org.apache.lucene.analysis.Analyzer
getReuseStrategy, getVersion, normalize, setVersion, tokenStream, tokenStream
-
Constructor Details
-
NamedAnalyzer
-
NamedAnalyzer
public NamedAnalyzer(String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer) -
NamedAnalyzer
public NamedAnalyzer(String name, AnalyzerScope scope, org.apache.lucene.analysis.Analyzer analyzer, int positionIncrementGap)
-
-
Method Details
-
name
The name of the analyzer. -
scope
The scope of the analyzer. -
getAnalysisMode
Returns whether this analyzer can be updated -
analyzer
public org.apache.lucene.analysis.Analyzer analyzer()The actual analyzer. -
getWrappedAnalyzer
- Specified by:
getWrappedAnalyzerin classorg.apache.lucene.analysis.AnalyzerWrapper
-
getPositionIncrementGap
- Overrides:
getPositionIncrementGapin classorg.apache.lucene.analysis.AnalyzerWrapper
-
checkAllowedInMode
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. -
containsBrokenAnalysis
public boolean containsBrokenAnalysis() -
toString
-
equals
-
hashCode
public int hashCode() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classorg.apache.lucene.analysis.Analyzer
-