From 0569a281a7dff2d1d706f09dc7105688beb171dd Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 20 Sep 2021 13:21:39 -0700 Subject: [PATCH] Fix split package in analysis-kuromoji plugin The analysis-kuromoji plugin reuses server package names for analysis and mappers. This commit moves the plugin implementation to use a single package name, o.e.p.analysis.kuromoji --- plugins/analysis-kuromoji/build.gradle | 13 ------------- .../analysis/kuromoji/AnalysisKuromojiPlugin.java | 9 --------- .../kuromoji}/JapaneseStopTokenFilterFactory.java | 6 ++++-- .../kuromoji}/KuromojiAnalyzerProvider.java | 4 +++- .../kuromoji}/KuromojiBaseFormFilterFactory.java | 3 ++- .../KuromojiIterationMarkCharFilterFactory.java | 4 +++- .../kuromoji}/KuromojiKatakanaStemmerFactory.java | 3 ++- .../kuromoji}/KuromojiNumberFilterFactory.java | 3 ++- .../KuromojiPartOfSpeechFilterFactory.java | 4 +++- .../KuromojiReadingFormFilterFactory.java | 3 ++- .../kuromoji}/KuromojiTokenizerFactory.java | 4 +++- .../kuromoji}/AnalysisKuromojiFactoryTests.java | 8 +++++++- .../analysis/kuromoji}/KuromojiAnalysisTests.java | 14 ++++++++++---- .../analysis/kuromoji}/empty_user_dict.txt | 0 .../analysis/kuromoji}/kuromoji_analysis.json | 0 .../analysis/kuromoji}/user_dict.txt | 0 16 files changed, 41 insertions(+), 37 deletions(-) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/JapaneseStopTokenFilterFactory.java (91%) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiAnalyzerProvider.java (90%) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiBaseFormFilterFactory.java (89%) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiIterationMarkCharFilterFactory.java (87%) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiKatakanaStemmerFactory.java (90%) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiNumberFilterFactory.java (89%) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiPartOfSpeechFilterFactory.java (89%) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiReadingFormFilterFactory.java (90%) rename plugins/analysis-kuromoji/src/main/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiTokenizerFactory.java (96%) rename plugins/analysis-kuromoji/src/test/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/AnalysisKuromojiFactoryTests.java (77%) rename plugins/analysis-kuromoji/src/test/java/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/KuromojiAnalysisTests.java (96%) rename plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/empty_user_dict.txt (100%) rename plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/kuromoji_analysis.json (100%) rename plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/{index/analysis => plugin/analysis/kuromoji}/user_dict.txt (100%) diff --git a/plugins/analysis-kuromoji/build.gradle b/plugins/analysis-kuromoji/build.gradle index 0b3beb8ab5dbe..3e6e1943e4d4b 100644 --- a/plugins/analysis-kuromoji/build.gradle +++ b/plugins/analysis-kuromoji/build.gradle @@ -25,16 +25,3 @@ restResources { tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } - -tasks.named('splitPackagesAudit').configure { - // o.e.i.analysis is owned by server, these should be moved to a kuromoji package - ignoreClasses 'org.elasticsearch.index.analysis.JapaneseStopTokenFilterFactory', - 'org.elasticsearch.index.analysis.KuromojiAnalyzerProvider', - 'org.elasticsearch.index.analysis.KuromojiBaseFormFilterFactory', - 'org.elasticsearch.index.analysis.KuromojiIterationMarkCharFilterFactory', - 'org.elasticsearch.index.analysis.KuromojiKatakanaStemmerFactory', - 'org.elasticsearch.index.analysis.KuromojiNumberFilterFactory', - 'org.elasticsearch.index.analysis.KuromojiPartOfSpeechFilterFactory', - 'org.elasticsearch.index.analysis.KuromojiReadingFormFilterFactory', - 'org.elasticsearch.index.analysis.KuromojiTokenizerFactory' -} diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/AnalysisKuromojiPlugin.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/AnalysisKuromojiPlugin.java index 2c2592e91e5e7..7d7e437e2631e 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/AnalysisKuromojiPlugin.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/AnalysisKuromojiPlugin.java @@ -11,15 +11,6 @@ import org.apache.lucene.analysis.Analyzer; import org.elasticsearch.index.analysis.AnalyzerProvider; import org.elasticsearch.index.analysis.CharFilterFactory; -import org.elasticsearch.index.analysis.JapaneseStopTokenFilterFactory; -import org.elasticsearch.index.analysis.KuromojiAnalyzerProvider; -import org.elasticsearch.index.analysis.KuromojiBaseFormFilterFactory; -import org.elasticsearch.index.analysis.KuromojiIterationMarkCharFilterFactory; -import org.elasticsearch.index.analysis.KuromojiKatakanaStemmerFactory; -import org.elasticsearch.index.analysis.KuromojiNumberFilterFactory; -import org.elasticsearch.index.analysis.KuromojiPartOfSpeechFilterFactory; -import org.elasticsearch.index.analysis.KuromojiReadingFormFilterFactory; -import org.elasticsearch.index.analysis.KuromojiTokenizerFactory; import org.elasticsearch.index.analysis.TokenFilterFactory; import org.elasticsearch.index.analysis.TokenizerFactory; import org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider; diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/JapaneseStopTokenFilterFactory.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/JapaneseStopTokenFilterFactory.java similarity index 91% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/JapaneseStopTokenFilterFactory.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/JapaneseStopTokenFilterFactory.java index c93fa789a2783..c2ff2047cff5d 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/JapaneseStopTokenFilterFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/JapaneseStopTokenFilterFactory.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.CharArraySet; @@ -17,13 +17,15 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; +import org.elasticsearch.index.analysis.Analysis; import java.util.Map; import java.util.Set; import static java.util.Collections.singletonMap; -public class JapaneseStopTokenFilterFactory extends AbstractTokenFilterFactory{ +public class JapaneseStopTokenFilterFactory extends AbstractTokenFilterFactory { private static final Map> NAMED_STOP_WORDS = singletonMap("_japanese_", JapaneseAnalyzer.getDefaultStopSet()); private final CharArraySet stopWords; diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiAnalyzerProvider.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiAnalyzerProvider.java similarity index 90% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiAnalyzerProvider.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiAnalyzerProvider.java index bd079b8369ef9..83c5f8559df35 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiAnalyzerProvider.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiAnalyzerProvider.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.ja.JapaneseAnalyzer; @@ -15,6 +15,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractIndexAnalyzerProvider; +import org.elasticsearch.index.analysis.Analysis; import java.util.Set; diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiBaseFormFilterFactory.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiBaseFormFilterFactory.java similarity index 89% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiBaseFormFilterFactory.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiBaseFormFilterFactory.java index a7362ef783604..5bb23298e1709 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiBaseFormFilterFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiBaseFormFilterFactory.java @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ja.JapaneseBaseFormFilter; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; public class KuromojiBaseFormFilterFactory extends AbstractTokenFilterFactory { diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiIterationMarkCharFilterFactory.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiIterationMarkCharFilterFactory.java similarity index 87% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiIterationMarkCharFilterFactory.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiIterationMarkCharFilterFactory.java index d043eb7e02464..857590d9716cd 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiIterationMarkCharFilterFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiIterationMarkCharFilterFactory.java @@ -6,12 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.ja.JapaneseIterationMarkCharFilter; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractCharFilterFactory; +import org.elasticsearch.index.analysis.NormalizingCharFilterFactory; import java.io.Reader; diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiKatakanaStemmerFactory.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiKatakanaStemmerFactory.java similarity index 90% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiKatakanaStemmerFactory.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiKatakanaStemmerFactory.java index 46932dd2387e3..c4bcbdd5a3d45 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiKatakanaStemmerFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiKatakanaStemmerFactory.java @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ja.JapaneseKatakanaStemFilter; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; public class KuromojiKatakanaStemmerFactory extends AbstractTokenFilterFactory { diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiNumberFilterFactory.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiNumberFilterFactory.java similarity index 89% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiNumberFilterFactory.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiNumberFilterFactory.java index 68fefb9db6314..ccda413929764 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiNumberFilterFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiNumberFilterFactory.java @@ -5,13 +5,14 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ja.JapaneseNumberFilter; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; public class KuromojiNumberFilterFactory extends AbstractTokenFilterFactory { diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiPartOfSpeechFilterFactory.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiPartOfSpeechFilterFactory.java similarity index 89% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiPartOfSpeechFilterFactory.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiPartOfSpeechFilterFactory.java index fb3378212a5ea..e8b717fb7fe32 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiPartOfSpeechFilterFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiPartOfSpeechFilterFactory.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ja.JapaneseAnalyzer; @@ -14,6 +14,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; +import org.elasticsearch.index.analysis.Analysis; import java.util.HashSet; import java.util.List; diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiReadingFormFilterFactory.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiReadingFormFilterFactory.java similarity index 90% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiReadingFormFilterFactory.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiReadingFormFilterFactory.java index ddffba397be16..58cf799c84e32 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiReadingFormFilterFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiReadingFormFilterFactory.java @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.ja.JapaneseReadingFormFilter; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; public class KuromojiReadingFormFilterFactory extends AbstractTokenFilterFactory { diff --git a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiTokenizerFactory.java b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiTokenizerFactory.java similarity index 96% rename from plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiTokenizerFactory.java rename to plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiTokenizerFactory.java index a5f3e9967334c..8425cdcabd635 100644 --- a/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/index/analysis/KuromojiTokenizerFactory.java +++ b/plugins/analysis-kuromoji/src/main/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiTokenizerFactory.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.ja.JapaneseTokenizer; @@ -17,6 +17,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; +import org.elasticsearch.index.analysis.AbstractTokenizerFactory; +import org.elasticsearch.index.analysis.Analysis; import java.io.IOException; import java.io.StringReader; diff --git a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/AnalysisKuromojiFactoryTests.java b/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/plugin/analysis/kuromoji/AnalysisKuromojiFactoryTests.java similarity index 77% rename from plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/AnalysisKuromojiFactoryTests.java rename to plugins/analysis-kuromoji/src/test/java/org/elasticsearch/plugin/analysis/kuromoji/AnalysisKuromojiFactoryTests.java index ec51c91dc1319..63f6f94f79033 100644 --- a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/AnalysisKuromojiFactoryTests.java +++ b/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/plugin/analysis/kuromoji/AnalysisKuromojiFactoryTests.java @@ -6,11 +6,17 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.ja.JapaneseTokenizerFactory; import org.elasticsearch.indices.analysis.AnalysisFactoryTestCase; import org.elasticsearch.plugin.analysis.kuromoji.AnalysisKuromojiPlugin; +import org.elasticsearch.plugin.analysis.kuromoji.KuromojiBaseFormFilterFactory; +import org.elasticsearch.plugin.analysis.kuromoji.KuromojiIterationMarkCharFilterFactory; +import org.elasticsearch.plugin.analysis.kuromoji.KuromojiKatakanaStemmerFactory; +import org.elasticsearch.plugin.analysis.kuromoji.KuromojiNumberFilterFactory; +import org.elasticsearch.plugin.analysis.kuromoji.KuromojiPartOfSpeechFilterFactory; +import org.elasticsearch.plugin.analysis.kuromoji.KuromojiReadingFormFilterFactory; import java.util.HashMap; import java.util.Map; diff --git a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiAnalysisTests.java b/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiAnalysisTests.java similarity index 96% rename from plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiAnalysisTests.java rename to plugins/analysis-kuromoji/src/test/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiAnalysisTests.java index ea2f2fe84c0c7..e85628b1e8d9a 100644 --- a/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/index/analysis/KuromojiAnalysisTests.java +++ b/plugins/analysis-kuromoji/src/test/java/org/elasticsearch/plugin/analysis/kuromoji/KuromojiAnalysisTests.java @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -package org.elasticsearch.index.analysis; +package org.elasticsearch.plugin.analysis.kuromoji; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -19,7 +19,13 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.Index; -import org.elasticsearch.plugin.analysis.kuromoji.AnalysisKuromojiPlugin; +import org.elasticsearch.index.analysis.AnalysisTestsHelper; +import org.elasticsearch.index.analysis.CharFilterFactory; +import org.elasticsearch.index.analysis.CustomAnalyzer; +import org.elasticsearch.index.analysis.IndexAnalyzers; +import org.elasticsearch.index.analysis.NamedAnalyzer; +import org.elasticsearch.index.analysis.TokenFilterFactory; +import org.elasticsearch.index.analysis.TokenizerFactory; import org.elasticsearch.test.ESTestCase; import java.io.IOException; @@ -69,7 +75,7 @@ public void testDefaultsKuromojiAnalysis() throws IOException { assertThat(analyzer.analyzer(), instanceOf(CustomAnalyzer.class)); assertThat(analyzer.analyzer().tokenStream(null, new StringReader("")), instanceOf(JapaneseTokenizer.class)); - CharFilterFactory charFilterFactory = analysis.charFilter.get("kuromoji_iteration_mark"); + CharFilterFactory charFilterFactory = analysis.charFilter.get("kuromoji_iteration_mark"); assertThat(charFilterFactory, instanceOf(KuromojiIterationMarkCharFilterFactory.class)); } @@ -199,7 +205,7 @@ private static TestAnalysis createTestAnalysis() throws IOException { Files.createDirectory(config); Files.copy(empty_dict, config.resolve("empty_user_dict.txt")); Files.copy(dict, config.resolve("user_dict.txt")); - String json = "/org/elasticsearch/index/analysis/kuromoji_analysis.json"; + String json = "/org/elasticsearch/plugin/analysis/kuromoji/kuromoji_analysis.json"; Settings settings = Settings.builder() .loadFromStream(json, KuromojiAnalysisTests.class.getResourceAsStream(json), false) diff --git a/plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/index/analysis/empty_user_dict.txt b/plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/plugin/analysis/kuromoji/empty_user_dict.txt similarity index 100% rename from plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/index/analysis/empty_user_dict.txt rename to plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/plugin/analysis/kuromoji/empty_user_dict.txt diff --git a/plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/index/analysis/kuromoji_analysis.json b/plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/plugin/analysis/kuromoji/kuromoji_analysis.json similarity index 100% rename from plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/index/analysis/kuromoji_analysis.json rename to plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/plugin/analysis/kuromoji/kuromoji_analysis.json diff --git a/plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/index/analysis/user_dict.txt b/plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/plugin/analysis/kuromoji/user_dict.txt similarity index 100% rename from plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/index/analysis/user_dict.txt rename to plugins/analysis-kuromoji/src/test/resources/org/elasticsearch/plugin/analysis/kuromoji/user_dict.txt