Package org.apache.lucene.analysis.core
Class StopAnalyzer
java.lang.Object
org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.util.StopwordAnalyzerBase
org.apache.lucene.analysis.core.StopAnalyzer
- All Implemented Interfaces:
Closeable
,AutoCloseable
Filters
LetterTokenizer
with LowerCaseFilter
and StopFilter
.
You must specify the required Version
compatibility when creating StopAnalyzer:
- As of 3.1, StopFilter correctly handles Unicode 4.0 supplementary characters in stopwords
- As of 2.9, position increments are preserved
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer
Analyzer.GlobalReuseStrategy, Analyzer.PerFieldReuseStrategy, Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CharArraySet
An unmodifiable set containing some common English words that are not usually useful for searching.Fields inherited from class org.apache.lucene.analysis.Analyzer
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
-
Constructor Summary
ConstructorsConstructorDescriptionStopAnalyzer
(Version matchVersion) Builds an analyzer which removes words inENGLISH_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, CharArraySet stopWords) Builds an analyzer with the stop words from the given set. -
Method Summary
Methods inherited from class org.apache.lucene.analysis.util.StopwordAnalyzerBase
getStopwordSet
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, tokenStream, tokenStream
-
Field Details
-
ENGLISH_STOP_WORDS_SET
An unmodifiable set containing some common English words that are not usually useful for searching.
-
-
Constructor Details
-
StopAnalyzer
Builds an analyzer which removes words inENGLISH_STOP_WORDS_SET
.- Parameters:
matchVersion
- See above
-
StopAnalyzer
Builds an analyzer with the stop words from the given set.- Parameters:
matchVersion
- See abovestopWords
- Set of stop words
-
StopAnalyzer
Builds an analyzer with the stop words from the given file.- Parameters:
matchVersion
- See abovestopwordsFile
- File to load stop words from- Throws:
IOException
- See Also:
-
StopAnalyzer
Builds an analyzer with the stop words from the given reader.- Parameters:
matchVersion
- See abovestopwords
- Reader to load stop words from- Throws:
IOException
- See Also:
-