Fix analysis-kuromoji to not use shaded APIs
This commit is contained in:
parent
8c52619436
commit
325188281f
|
@ -25,7 +25,6 @@ import org.apache.lucene.analysis.core.StopFilter;
|
|||
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
|
||||
import org.apache.lucene.analysis.util.CharArraySet;
|
||||
import org.apache.lucene.search.suggest.analyzing.SuggestStopFilter;
|
||||
import org.elasticsearch.common.collect.ImmutableMap;
|
||||
import org.elasticsearch.common.collect.MapBuilder;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.inject.assistedinject.Assisted;
|
||||
|
@ -34,6 +33,7 @@ import org.elasticsearch.env.Environment;
|
|||
import org.elasticsearch.index.Index;
|
||||
import org.elasticsearch.index.settings.IndexSettings;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class JapaneseStopTokenFilterFactory extends AbstractTokenFilterFactory{
|
||||
|
@ -50,7 +50,7 @@ public class JapaneseStopTokenFilterFactory extends AbstractTokenFilterFactory{
|
|||
super(index, indexSettings, name, settings);
|
||||
this.ignoreCase = settings.getAsBoolean("ignore_case", false);
|
||||
this.removeTrailing = settings.getAsBoolean("remove_trailing", true);
|
||||
ImmutableMap<String, Set<?>> namedStopWords = MapBuilder.<String, Set<?>>newMapBuilder()
|
||||
Map<String, Set<?>> namedStopWords = MapBuilder.<String, Set<?>>newMapBuilder()
|
||||
.put("_japanese_", JapaneseAnalyzer.getDefaultStopSet())
|
||||
.immutableMap();
|
||||
this.stopWords = Analysis.parseWords(env, settings, "stopwords", JapaneseAnalyzer.getDefaultStopSet(), namedStopWords, ignoreCase);
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
|
||||
package org.elasticsearch.plugin.analysis.kuromoji;
|
||||
|
||||
import org.elasticsearch.common.collect.ImmutableList;
|
||||
import org.elasticsearch.common.inject.Module;
|
||||
import org.elasticsearch.index.analysis.*;
|
||||
import org.elasticsearch.indices.analysis.KuromojiIndicesAnalysisModule;
|
||||
import org.elasticsearch.plugins.AbstractPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
|
@ -44,7 +44,9 @@ public class AnalysisKuromojiPlugin extends AbstractPlugin {
|
|||
|
||||
@Override
|
||||
public Collection<Class<? extends Module>> modules() {
|
||||
return ImmutableList.<Class<? extends Module>>of(KuromojiIndicesAnalysisModule.class);
|
||||
Collection<Class<? extends Module>> classes = new ArrayList<>();
|
||||
classes.add(KuromojiIndicesAnalysisModule.class);
|
||||
return classes;
|
||||
}
|
||||
|
||||
public void onModule(AnalysisModule module) {
|
||||
|
|
Loading…
Reference in New Issue