Package org.elasticsearch.index.analysis
Class CustomAnalyzer
java.lang.Object
org.apache.lucene.analysis.Analyzer
org.elasticsearch.index.analysis.CustomAnalyzer
- All Implemented Interfaces:
Closeable,AutoCloseable,AnalyzerComponentsProvider
public final class CustomAnalyzer
extends org.apache.lucene.analysis.Analyzer
implements AnalyzerComponentsProvider
-
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
ConstructorsConstructorDescriptionCustomAnalyzer(TokenizerFactory tokenizerFactory, CharFilterFactory[] charFilters, TokenFilterFactory[] tokenFilters)CustomAnalyzer(TokenizerFactory tokenizerFactory, CharFilterFactory[] charFilters, TokenFilterFactory[] tokenFilters, int positionIncrementGap, int offsetGap) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.analysis.Analyzer.TokenStreamComponentscreateComponents(String fieldName)intgetOffsetGap(String field)intgetPositionIncrementGap(String fieldName)protected ReaderinitReader(String fieldName, Reader reader)protected ReaderinitReaderForNormalization(String fieldName, Reader reader)protected org.apache.lucene.analysis.TokenStreamMethods inherited from class org.apache.lucene.analysis.Analyzer
attributeFactory, close, getReuseStrategy, getVersion, normalize, setVersion, tokenStream, tokenStream
-
Constructor Details
-
CustomAnalyzer
public CustomAnalyzer(TokenizerFactory tokenizerFactory, CharFilterFactory[] charFilters, TokenFilterFactory[] tokenFilters) -
CustomAnalyzer
public CustomAnalyzer(TokenizerFactory tokenizerFactory, CharFilterFactory[] charFilters, TokenFilterFactory[] tokenFilters, int positionIncrementGap, int offsetGap)
-
-
Method Details
-
tokenizerFactory
-
tokenFilters
-
charFilters
-
getPositionIncrementGap
- Overrides:
getPositionIncrementGapin classorg.apache.lucene.analysis.Analyzer
-
getOffsetGap
- Overrides:
getOffsetGapin classorg.apache.lucene.analysis.Analyzer
-
getAnalysisMode
-
getComponents
- Specified by:
getComponentsin interfaceAnalyzerComponentsProvider
-
createComponents
protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents createComponents(String fieldName)- Specified by:
createComponentsin classorg.apache.lucene.analysis.Analyzer
-
initReader
- Overrides:
initReaderin classorg.apache.lucene.analysis.Analyzer
-
initReaderForNormalization
- Overrides:
initReaderForNormalizationin classorg.apache.lucene.analysis.Analyzer
-
normalize
protected org.apache.lucene.analysis.TokenStream normalize(String fieldName, org.apache.lucene.analysis.TokenStream in)- Overrides:
normalizein classorg.apache.lucene.analysis.Analyzer
-