Skip to content

Commit

Permalink
Fix split package in analysis-nori plugin (#78040) (#78117)
Browse files Browse the repository at this point in the history
The analysis-nori plugin reuses server the server package name for
analysis. This commit moves the plugin implementation to use a single
package name, o.e.p.analysis.nori
  • Loading branch information
rjernst authored Sep 21, 2021
1 parent 35873b7 commit 511e4bd
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 23 deletions.
9 changes: 0 additions & 9 deletions plugins/analysis-nori/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,3 @@ restResources {
tasks.named("dependencyLicenses").configure {
mapping from: /lucene-.*/, to: 'lucene'
}

tasks.named('splitPackagesAudit').configure {
// Lucene packages should be owned by Lucene!
ignoreClasses 'org.elasticsearch.index.analysis.NoriAnalyzerProvider',
'org.elasticsearch.index.analysis.NoriNumberFilterFactory',
'org.elasticsearch.index.analysis.NoriPartOfSpeechStopFilterFactory',
'org.elasticsearch.index.analysis.NoriReadingFormFilterFactory',
'org.elasticsearch.index.analysis.NoriTokenizerFactory'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@

import org.apache.lucene.analysis.Analyzer;
import org.elasticsearch.index.analysis.AnalyzerProvider;
import org.elasticsearch.index.analysis.NoriAnalyzerProvider;
import org.elasticsearch.index.analysis.NoriNumberFilterFactory;
import org.elasticsearch.index.analysis.NoriPartOfSpeechStopFilterFactory;
import org.elasticsearch.index.analysis.NoriReadingFormFilterFactory;
import org.elasticsearch.index.analysis.NoriTokenizerFactory;
import org.elasticsearch.index.analysis.TokenFilterFactory;
import org.elasticsearch.index.analysis.TokenizerFactory;
import org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.index.analysis;
package org.elasticsearch.plugin.analysis.nori;

import java.util.List;
import java.util.Set;
Expand All @@ -18,8 +18,10 @@
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 static org.elasticsearch.index.analysis.NoriPartOfSpeechStopFilterFactory.resolvePOSList;
import static org.elasticsearch.plugin.analysis.nori.NoriPartOfSpeechStopFilterFactory.resolvePOSList;


public class NoriAnalyzerProvider extends AbstractIndexAnalyzerProvider<KoreanAnalyzer> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
* Side Public License, v 1.
*/

package org.elasticsearch.index.analysis;
package org.elasticsearch.plugin.analysis.nori;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.ko.KoreanNumberFilter;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.analysis.AbstractTokenFilterFactory;

public class NoriNumberFilterFactory extends AbstractTokenFilterFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
* Side Public License, v 1.
*/

package org.elasticsearch.index.analysis;
package org.elasticsearch.plugin.analysis.nori;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.ko.KoreanPartOfSpeechStopFilter;
import org.apache.lucene.analysis.ko.POS;
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
* Side Public License, v 1.
*/

package org.elasticsearch.index.analysis;
package org.elasticsearch.plugin.analysis.nori;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.ko.KoreanReadingFormFilter;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.analysis.AbstractTokenFilterFactory;

public class NoriReadingFormFilterFactory extends AbstractTokenFilterFactory {
public NoriReadingFormFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.index.analysis;
package org.elasticsearch.plugin.analysis.nori;

import org.apache.lucene.analysis.Tokenizer;
import org.apache.lucene.analysis.ko.KoreanTokenizer;
Expand All @@ -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.AbstractTokenizerFactory;
import org.elasticsearch.index.analysis.Analysis;

import java.io.IOException;
import java.io.Reader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
* Side Public License, v 1.
*/

package org.elasticsearch.index.analysis;
package org.elasticsearch.plugin.analysis.nori;

import org.apache.lucene.analysis.ko.KoreanTokenizerFactory;
import org.elasticsearch.indices.analysis.AnalysisFactoryTestCase;
import org.elasticsearch.plugin.analysis.nori.AnalysisNoriPlugin;
import org.elasticsearch.plugin.analysis.nori.NoriNumberFilterFactory;
import org.elasticsearch.plugin.analysis.nori.NoriPartOfSpeechStopFilterFactory;
import org.elasticsearch.plugin.analysis.nori.NoriReadingFormFilterFactory;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.index.analysis;
package org.elasticsearch.plugin.analysis.nori;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
Expand All @@ -17,7 +17,11 @@
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment;
import org.elasticsearch.plugin.analysis.nori.AnalysisNoriPlugin;
import org.elasticsearch.index.analysis.AnalysisTestsHelper;
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.TestAnalysis;
import org.elasticsearch.test.ESTokenStreamTestCase;

Expand Down

0 comments on commit 511e4bd

Please sign in to comment.