Reputation: 307
How do I implement "Exclude these words" feature for a search appliation using Lucene?
Thanks!
Upvotes: 0
Views: 1701
Reputation: 2438
therefor i can use the stopanalyzer:
StopAnalyzer StopAnalyzer includes the lower-case filter, and also has a filter that drops out any "stop words", words like articles (a, an, the, etc) that occur so commonly in english that they might as well be noise for searching purposes. StopAnalyzer comes with a set of stop words, but you can instantiate it with your own array of stop words.
http://lucene.apache.org/java/2_3_0/api/org/apache/lucene/analysis/StopAnalyzer.html
more information: http://www.darksleep.com/lucene/ How to sort by Lucene.Net field and ignore common stop words such as 'a' and 'the'?
Upvotes: 1