Reputation: 39
I know that Lucene uses a stop word(common) filter for searching and I also know that for this job the Standard Analyzer or EnglishAnalyzer are responsible. What about, if I want to add my own common words to the analyzer filter? How could I add words like computer, internet, system, etc.
Upvotes: 1
Views: 176
Reputation: 26733
I assume by "common words" you mean stopwords.
In order to add to standard list, just use another constructor of StandardAnalyzer
(which accepts stopwords either as CharArraySet
or Reader
). To get standard stopword set, use StopAnalyzer.STOP_WORDS_SET
.
Upvotes: 2