public final class

StopAnalyzer

extends Analyzer
java.lang.Object
   ↳ org.apache.lucene.analysis.Analyzer
     ↳ org.apache.lucene.analysis.StopAnalyzer

Class Overview

Filters LetterTokenizer with LowerCaseFilter and StopFilter.

You must specify the required Version compatibility when creating StopAnalyzer:

  • As of 2.9, position increments are preserved

Summary

Fields
public static final Set<?> ENGLISH_STOP_WORDS_SET An unmodifiable set containing some common English words that are not usually useful for searching.
[Expand]
Inherited Fields
From class org.apache.lucene.analysis.Analyzer
Public Constructors
StopAnalyzer(Version matchVersion)
Builds an analyzer which removes words in ENGLISH_STOP_WORDS_SET.
StopAnalyzer(Version matchVersion, Set<?> stopWords)
Builds an analyzer with the stop words from the given 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.
Public Methods
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)
Filters LowerCaseTokenizer with StopFilter.
[Expand]
Inherited Methods
From class org.apache.lucene.analysis.Analyzer
From class java.lang.Object
From interface java.io.Closeable

Fields

public static final Set<?> ENGLISH_STOP_WORDS_SET

An unmodifiable set containing some common English words that are not usually useful for searching.

Public Constructors

public StopAnalyzer (Version matchVersion)

Builds an analyzer which removes words in ENGLISH_STOP_WORDS_SET.

Parameters
matchVersion See above

public StopAnalyzer (Version matchVersion, Set<?> stopWords)

Builds an analyzer with the stop words from the given set.

Parameters
matchVersion See above
stopWords Set of stop words

public StopAnalyzer (Version matchVersion, File stopwordsFile)

Builds an analyzer with the stop words from the given file.

Parameters
matchVersion See above
stopwordsFile File to load stop words from
Throws
IOException
See Also

public StopAnalyzer (Version matchVersion, Reader stopwords)

Builds an analyzer with the stop words from the given reader.

Parameters
matchVersion See above
stopwords Reader to load stop words from
Throws
IOException

Public Methods

public 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. Callers that do not need to use more than one TokenStream at the same time from this analyzer should use this method for better performance.

Throws
IOException

public TokenStream tokenStream (String fieldName, Reader reader)

Filters LowerCaseTokenizer with StopFilter.