public final class LimitTokenCountAnalyzer extends AnalyzerWrapper
IndexWriter
.LimitTokenCountFilter
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
Constructor and Description |
---|
LimitTokenCountAnalyzer(Analyzer delegate,
int maxTokenCount)
Build an analyzer that limits the maximum number of tokens per field.
|
LimitTokenCountAnalyzer(Analyzer delegate,
int maxTokenCount,
boolean consumeAllTokens)
Build an analyzer that limits the maximum number of tokens per field.
|
Modifier and Type | Method and Description |
---|---|
protected Analyzer |
getWrappedAnalyzer(String fieldName) |
String |
toString() |
protected Analyzer.TokenStreamComponents |
wrapComponents(String fieldName,
Analyzer.TokenStreamComponents components) |
createComponents, getOffsetGap, getPositionIncrementGap, initReader, wrapReader
close, getReuseStrategy, getVersion, setVersion, tokenStream, tokenStream
public LimitTokenCountAnalyzer(Analyzer delegate, int maxTokenCount)
public LimitTokenCountAnalyzer(Analyzer delegate, int maxTokenCount, boolean consumeAllTokens)
delegate
- the analyzer to wrapmaxTokenCount
- max number of tokens to produceconsumeAllTokens
- whether all tokens from the delegate should be consumed even if maxTokenCount is reached.protected Analyzer getWrappedAnalyzer(String fieldName)
getWrappedAnalyzer
in class AnalyzerWrapper
protected Analyzer.TokenStreamComponents wrapComponents(String fieldName, Analyzer.TokenStreamComponents components)
wrapComponents
in class AnalyzerWrapper
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.