Class LimitTokenOffsetAnalyzer
java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.AnalyzerWrapper
org.elasticsearch.search.fetch.subphase.highlight.LimitTokenOffsetAnalyzer
- All Implemented Interfaces:
- Closeable,- AutoCloseable
public final class LimitTokenOffsetAnalyzer
extends org.apache.lucene.analysis.AnalyzerWrapper
This analyzer limits the highlighting once it sees a token with a start offset <= the configured limit,
 which won't pass and will end the stream.
- See Also:
- LimitTokenOffsetFilter
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzerorg.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents
- 
Field SummaryFields inherited from class org.apache.lucene.analysis.AnalyzerGLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
- 
Constructor SummaryConstructorsConstructorDescriptionLimitTokenOffsetAnalyzer(org.apache.lucene.analysis.Analyzer delegate, int maxOffset)Build an analyzer that limits the highlighting once it sees a token with a start offset <= the configured limit, which won't pass and will end the stream.
- 
Method SummaryModifier and TypeMethodDescriptionprotected org.apache.lucene.analysis.AnalyzergetWrappedAnalyzer(String fieldName)toString()protected org.apache.lucene.analysis.Analyzer.TokenStreamComponentswrapComponents(String fieldName, org.apache.lucene.analysis.Analyzer.TokenStreamComponents components)Methods inherited from class org.apache.lucene.analysis.AnalyzerWrapperattributeFactory, createComponents, getOffsetGap, getPositionIncrementGap, initReader, initReaderForNormalization, normalize, wrapReader, wrapReaderForNormalization, wrapTokenStreamForNormalizationMethods inherited from class org.apache.lucene.analysis.Analyzerclose, getReuseStrategy, getVersion, normalize, setVersion, tokenStream, tokenStream
- 
Constructor Details- 
LimitTokenOffsetAnalyzerpublic LimitTokenOffsetAnalyzer(org.apache.lucene.analysis.Analyzer delegate, int maxOffset)Build an analyzer that limits the highlighting once it sees a token with a start offset <= the configured limit, which won't pass and will end the stream. SeeLimitTokenOffsetFilterfor more details.- Parameters:
- delegate- the analyzer to wrap
- maxOffset- max number of tokens to produce
 
 
- 
- 
Method Details- 
getWrappedAnalyzer- Specified by:
- getWrappedAnalyzerin class- org.apache.lucene.analysis.AnalyzerWrapper
 
- 
wrapComponentsprotected org.apache.lucene.analysis.Analyzer.TokenStreamComponents wrapComponents(String fieldName, org.apache.lucene.analysis.Analyzer.TokenStreamComponents components)- Overrides:
- wrapComponentsin class- org.apache.lucene.analysis.AnalyzerWrapper
 
- 
toString
 
-