From 60578aef4da8b7300de060f5469b7a1ee47fe4dd Mon Sep 17 00:00:00 2001 From: kimchy Date: Thu, 17 Feb 2011 22:22:34 +0200 Subject: [PATCH] add name as another setting to set on snowball, not just language --- .../elasticsearch/index/analysis/SnowballAnalyzerProvider.java | 2 +- .../index/analysis/SnowballTokenFilterFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/SnowballAnalyzerProvider.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/SnowballAnalyzerProvider.java index 36dfdaa8307..0dbf271580f 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/SnowballAnalyzerProvider.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/SnowballAnalyzerProvider.java @@ -65,7 +65,7 @@ public class SnowballAnalyzerProvider extends AbstractIndexAnalyzerProvider defaultStopwords = defaultLanguageStopwords.containsKey(language) ? defaultLanguageStopwords.get(language) : ImmutableSet.>of(); Set stopWords = Analysis.parseStopWords(settings, defaultStopwords); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/SnowballTokenFilterFactory.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/SnowballTokenFilterFactory.java index 1405e6b727d..1be9388a3e3 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/SnowballTokenFilterFactory.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/analysis/SnowballTokenFilterFactory.java @@ -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) {