lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Curtin" <>
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!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message