|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.analysis.Analyzer org.apache.lucene.analysis.LimitTokenCountAnalyzer
public final class LimitTokenCountAnalyzer
This Analyzer limits the number of tokens while indexing. It is
a replacement for the maximum field length setting inside IndexWriter
.
Constructor Summary | |
---|---|
LimitTokenCountAnalyzer(Analyzer delegate,
int maxTokenCount)
Build an analyzer that limits the maximum number of tokens per field. |
Method Summary | |
---|---|
int |
getOffsetGap(Fieldable field)
Just like Analyzer.getPositionIncrementGap(java.lang.String) , except for
Token offsets instead. |
int |
getPositionIncrementGap(String fieldName)
Invoked before indexing a Fieldable instance if terms have already been added to that field. |
TokenStream |
reusableTokenStream(String fieldName,
Reader reader)
Creates a TokenStream that is allowed to be re-used from the previous time that the same thread called this method. |
TokenStream |
tokenStream(String fieldName,
Reader reader)
Creates a TokenStream which tokenizes all the text in the provided Reader. |
String |
toString()
|
Methods inherited from class org.apache.lucene.analysis.Analyzer |
---|
close, getPreviousTokenStream, setPreviousTokenStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LimitTokenCountAnalyzer(Analyzer delegate, int maxTokenCount)
Method Detail |
---|
public TokenStream tokenStream(String fieldName, Reader reader)
Analyzer
tokenStream
in class Analyzer
public TokenStream reusableTokenStream(String fieldName, Reader reader) throws IOException
Analyzer
reusableTokenStream
in class Analyzer
IOException
public int getPositionIncrementGap(String fieldName)
Analyzer
getPositionIncrementGap
in class Analyzer
fieldName
- Fieldable name being indexed.
Analyzer.tokenStream(String,Reader)
public int getOffsetGap(Fieldable field)
Analyzer
Analyzer.getPositionIncrementGap(java.lang.String)
, except for
Token offsets instead. By default this returns 1 for
tokenized fields and, as if the fields were joined
with an extra space character, and 0 for un-tokenized
fields. This method is only called if the field
produced at least one token for indexing.
getOffsetGap
in class Analyzer
field
- the field just indexed
Analyzer.tokenStream(String,Reader)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |