diff --git a/README.md b/README.md index 2612527..9409514 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # elasticsearch-remove-token-filter -This is a customized stop filter plugin, compatible with ES 5.6.5. This stop filter completely removes stop word's +This is a customized stop filter plugin, compatible with ES 7.2.1. This stop filter completely removes stop word's token position from the token stream whereas the ES build-in stop filter only removes the stop word token but preserves the stop word token position. The difference can be best illustrated with the following use case. diff --git a/pom.xml b/pom.xml index 9b81cb2..716b556 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 elasticsearch.tokenremove elasticsearch-tokenremove - 1.2.1 + 1.2.2 jar A customized token filter that drops stop word tokens completely from the token stream including their token positions 2018 @@ -19,7 +19,7 @@ - 5.6.5 + 7.2.1 UTF-8 false ${skipTests} diff --git a/src/main/assemblies/plugin.xml b/src/main/assemblies/plugin.xml index 48157c6..4f6506b 100644 --- a/src/main/assemblies/plugin.xml +++ b/src/main/assemblies/plugin.xml @@ -8,15 +8,13 @@ ${project.basedir}/src/main/resources/plugin-descriptor.properties - elasticsearch true - elasticsearch true true - \ No newline at end of file + diff --git a/src/main/java/elasticsearch/tokenremove/RemoveTokenFilterFactory.java b/src/main/java/elasticsearch/tokenremove/RemoveTokenFilterFactory.java index 90bbee6..c431902 100644 --- a/src/main/java/elasticsearch/tokenremove/RemoveTokenFilterFactory.java +++ b/src/main/java/elasticsearch/tokenremove/RemoveTokenFilterFactory.java @@ -2,7 +2,7 @@ import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.analysis.core.StopAnalyzer; +import org.apache.lucene.analysis.en.EnglishAnalyzer; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; @@ -17,11 +17,11 @@ public class RemoveTokenFilterFactory extends AbstractTokenFilterFactory { public RemoveTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) { super(indexSettings, name, settings); this.ignoreCase = settings.getAsBoolean("ignore_case", false); - this.stopWords = Analysis.parseStopWords(env, settings, StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase); + this.stopWords = Analysis.parseStopWords(env, settings, EnglishAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase); } @Override public TokenStream create(TokenStream tokenStream) { return new RemoveTokenFilter(tokenStream, stopWords); } -} \ No newline at end of file +}