Skip to content
Permalink
Browse files

allow to sepcify stopwords as comma delimiated list of words

  • Loading branch information...
kimchy committed Sep 26, 2010
1 parent efe5b57 commit d9c2cc9d37331db8f002b491ff36eb82efd2338a
@@ -19,6 +19,7 @@

package org.elasticsearch.index.analysis;

import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.ImmutableSet;
import org.elasticsearch.common.collect.Iterators;
import org.elasticsearch.common.settings.Settings;
@@ -37,8 +38,12 @@ public static boolean isNoStopwords(Settings settings) {

public static Set<?> parseStopWords(Settings settings, Set<?> defaultStopWords) {
String value = settings.get("stopwords");
if (value != null && "_none_".equals(value)) {
return ImmutableSet.of();
if (value != null) {
if ("_none_".equals(value)) {
return ImmutableSet.of();
} else {
return ImmutableSet.copyOf(Strings.commaDelimitedListToSet(value));
}
}
String[] stopWords = settings.getAsArray("stopwords", null);
if (stopWords != null) {

0 comments on commit d9c2cc9

Please sign in to comment.
You can’t perform that action at this time.