public final class StandardAnalyzer extends StopwordAnalyzerBase
StandardTokenizer with LowerCaseFilter and
 StopFilter, using a configurable list of stop words.Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents| Modifier and Type | Field and Description | 
|---|---|
| static int | DEFAULT_MAX_TOKEN_LENGTHDefault maximum allowed token length | 
stopwordsGLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY| Constructor and Description | 
|---|
| StandardAnalyzer()Builds an analyzer with no stop words. | 
| StandardAnalyzer(CharArraySet stopWords)Builds an analyzer with the given stop words. | 
| StandardAnalyzer(Reader stopwords)Builds an analyzer with the stop words from the given reader. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Analyzer.TokenStreamComponents | createComponents(String fieldName)Creates a new  Analyzer.TokenStreamComponentsinstance for this analyzer. | 
| int | getMaxTokenLength()Returns the current maximum token length | 
| protected TokenStream | normalize(String fieldName,
         TokenStream in)Wrap the given  TokenStreamin order to apply normalization filters. | 
| void | setMaxTokenLength(int length)Set the max allowed token length. | 
getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSetattributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, setVersion, tokenStream, tokenStreampublic static final int DEFAULT_MAX_TOKEN_LENGTH
public StandardAnalyzer(CharArraySet stopWords)
stopWords - stop wordspublic StandardAnalyzer()
public StandardAnalyzer(Reader stopwords) throws IOException
stopwords - Reader to read stop words fromIOExceptionWordlistLoader.getWordSet(Reader)public void setMaxTokenLength(int length)
LengthFilter to remove long tokens.  The default is
 DEFAULT_MAX_TOKEN_LENGTH.public int getMaxTokenLength()
setMaxTokenLength(int)protected Analyzer.TokenStreamComponents createComponents(String fieldName)
AnalyzerAnalyzer.TokenStreamComponents instance for this analyzer.createComponents in class AnalyzerfieldName - the name of the fields content passed to the
          Analyzer.TokenStreamComponents sink as a readerAnalyzer.TokenStreamComponents for this analyzer.protected TokenStream normalize(String fieldName, TokenStream in)
AnalyzerTokenStream in order to apply normalization filters.
 The default implementation returns the TokenStream as-is. This is
 used by Analyzer.normalize(String, String).Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.