org.codelibs.elasticsearch.fess.FessAnalysisPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-analysis-fess Show documentation
Show all versions of elasticsearch-analysis-fess Show documentation
This plugin provides an analysis library for Fess.
/*
* Copyright 2012-2022 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.elasticsearch.fess;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import org.codelibs.elasticsearch.fess.action.AnalysisAction;
import org.codelibs.elasticsearch.fess.action.TransportAnalysisAction;
import org.codelibs.elasticsearch.fess.index.analysis.chinese.ChineseNoOpTokenFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.chinese.ChineseStopTokenFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.chinese.ChineseTokenizerFactory;
import org.codelibs.elasticsearch.fess.index.analysis.chinese.TraditionalChineseConvertCharFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.japanese.JapaneseBaseFormFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.japanese.JapaneseIterationMarkCharFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.japanese.JapaneseKatakanaStemmerFactory;
import org.codelibs.elasticsearch.fess.index.analysis.japanese.JapanesePartOfSpeechFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.japanese.JapaneseReadingFormFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.japanese.JapaneseTokenizerFactory;
import org.codelibs.elasticsearch.fess.index.analysis.japanese.ReloadableJapaneseTokenizerFactory;
import org.codelibs.elasticsearch.fess.index.analysis.korean.KoreanNumberFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.korean.KoreanPartOfSpeechStopFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.korean.KoreanReadingFormFilterFactory;
import org.codelibs.elasticsearch.fess.index.analysis.korean.KoreanTokenizerFactory;
import org.codelibs.elasticsearch.fess.index.analysis.vietnamese.VietnameseTokenizerFactory;
import org.codelibs.elasticsearch.fess.service.FessAnalysisService;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.env.Environment;
import org.elasticsearch.env.NodeEnvironment;
import org.elasticsearch.index.analysis.CharFilterFactory;
import org.elasticsearch.index.analysis.TokenFilterFactory;
import org.elasticsearch.index.analysis.TokenizerFactory;
import org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.AnalysisPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.repositories.RepositoriesService;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.tracing.Tracer;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.elasticsearch.xcontent.NamedXContentRegistry;
@SuppressWarnings("deprecation")
public class FessAnalysisPlugin extends Plugin implements ActionPlugin, AnalysisPlugin {
private FessAnalysisService service;
@Override
public List> getActions() {
return Arrays.asList(//
new ActionHandler<>(AnalysisAction.INSTANCE, TransportAnalysisAction.class));
}
@Override
public Collection