add name as another setting to set on snowball, not just language
This commit is contained in:
parent
c67912e259
commit
60578aef4d
|
@ -65,7 +65,7 @@ public class SnowballAnalyzerProvider extends AbstractIndexAnalyzerProvider<Snow
|
|||
@Inject public SnowballAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
|
||||
super(index, indexSettings, name);
|
||||
|
||||
String language = settings.get("language", "English");
|
||||
String language = settings.get("language", settings.get("name", "English"));
|
||||
Set<?> defaultStopwords = defaultLanguageStopwords.containsKey(language) ? defaultLanguageStopwords.get(language) : ImmutableSet.<Set<?>>of();
|
||||
Set<?> stopWords = Analysis.parseStopWords(settings, defaultStopwords);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public class SnowballTokenFilterFactory extends AbstractTokenFilterFactory {
|
|||
|
||||
@Inject public SnowballTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
|
||||
super(index, indexSettings, name);
|
||||
this.language = settings.get("language", "English");
|
||||
this.language = settings.get("language", settings.get("name", "English"));
|
||||
}
|
||||
|
||||
@Override public TokenStream create(TokenStream tokenStream) {
|
||||
|
|
Loading…
Reference in New Issue