Closeable, AutoCloseablepublic final class StopAnalyzer extends StopwordAnalyzerBase
LetterTokenizer with LowerCaseFilter and StopFilter.
You must specify the required Version
compatibility when creating StopAnalyzer:
ReusableAnalyzerBase.TokenStreamComponents| Modifier and Type | Field | Description |
|---|---|---|
static Set<?> |
ENGLISH_STOP_WORDS_SET |
An unmodifiable set containing some common English words that are not usually useful
for searching.
|
matchVersion, stopwords| Constructor | Description |
|---|---|
StopAnalyzer(Version matchVersion) |
Builds an analyzer which removes words in
ENGLISH_STOP_WORDS_SET. |
StopAnalyzer(Version matchVersion,
File stopwordsFile) |
Builds an analyzer with the stop words from the given file.
|
StopAnalyzer(Version matchVersion,
Reader stopwords) |
Builds an analyzer with the stop words from the given reader.
|
StopAnalyzer(Version matchVersion,
Set<?> stopWords) |
Builds an analyzer with the stop words from the given set.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected ReusableAnalyzerBase.TokenStreamComponents |
createComponents(String fieldName,
Reader reader) |
Creates
ReusableAnalyzerBase.TokenStreamComponents
used to tokenize all the text in the provided Reader. |
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, setPreviousTokenStreamclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitReader, reusableTokenStream, tokenStreamgetStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSetpublic static final Set<?> ENGLISH_STOP_WORDS_SET
public StopAnalyzer(Version matchVersion)
ENGLISH_STOP_WORDS_SET.matchVersion - See abovepublic StopAnalyzer(Version matchVersion, Set<?> stopWords)
matchVersion - See abovestopWords - Set of stop wordspublic StopAnalyzer(Version matchVersion, File stopwordsFile) throws IOException
matchVersion - See abovestopwordsFile - File to load stop words fromIOExceptionWordlistLoader.getWordSet(Reader, Version)public StopAnalyzer(Version matchVersion, Reader stopwords) throws IOException
matchVersion - See abovestopwords - Reader to load stop words fromIOExceptionWordlistLoader.getWordSet(Reader, Version)protected ReusableAnalyzerBase.TokenStreamComponents createComponents(String fieldName, Reader reader)
ReusableAnalyzerBase.TokenStreamComponents
used to tokenize all the text in the provided Reader.createComponents in class ReusableAnalyzerBasefieldName - the name of the fields content passed to the
ReusableAnalyzerBase.TokenStreamComponents sink as a readerreader - the reader passed to the Tokenizer constructorReusableAnalyzerBase.TokenStreamComponents
built from a LowerCaseTokenizer filtered with
StopFilterCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.