lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Halliday (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4284) RFE: stopword filter without lowercase side-effect
Date Thu, 02 Aug 2012 14:43:02 GMT


Sam Halliday commented on LUCENE-4284:

OK, thanks. Actually all I needed was to remove stop words from a String, so the following
did the trick

            Set<Object> stops = StopFilter.makeStopSet(Version.LUCENE_36, Lists.newArrayList(StopAnalyzer.ENGLISH_STOP_WORDS_SET),
            Tokenizer tokeniser = new ClassicTokenizer(Version.LUCENE_36, new StringReader(text));
            StopFilter stopFilter = new StopFilter(Version.LUCENE_36, tokeniser, stops);

            List<String> words = Lists.newArrayList();
            try {
                while (stopFilter.incrementToken()) {
                    String token = stopFilter.getAttribute(CharTermAttribute.class).toString();
            } catch (IOException ex) {
                throw new GuruMeditationFailure();

The API is a bit of a labyrinth - it'll take me some time to understand many of the design
> RFE: stopword filter without lowercase side-effect
> --------------------------------------------------
>                 Key: LUCENE-4284
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Sam Halliday
>            Priority: Minor
> It would appear that accept()-time lowercasing of Tokens is not favourable anymore, due
to the @Deprecation of the only constructor in StopFilter that allows this.
> Please support some way to allow stop-word removal without lowercasing the output:

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message