lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Curtin" <m...@curtin.com>
Subject Re: Multiple Analyzers
Date Thu, 17 Nov 2005 16:18:32 GMT
> Hi everybody, I want to know how to create an analyzer whith this and 
> StopFilter  and LowerCaseFilter. Exists some example anywhere?
> thks for replies

Not bad at all.  StopAnalyzer by itself may do what you want.  If not, here's an example of
a custom analyzer:

class MyAnalyzer extends Analyzer {
    public TokenStream tokenStream(String fieldName, Reader reader) {
        TokenStream result = new StandardTokenizer(reader);
        result = new LowerCaseFilter(result);
        result = new StopFilter(result, StopAnalyzer.ENGLISH_STOP_WORDS);
        return result;
}

Note that the filters compose each other, so that you can set up a chain of them.  Good luck!

--MDC

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message