in v 2.3.5 of Elastic, I could register a bespoke Analyzer using this code, but in v5.2.2 the class
org.elasticsearch.indices.analysis.IndicesAnalysisService has been removed.
What's the current way, using the java api, to register a bespoke analyzer chain ?
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.analysis.AnalyzerScope;
import org.elasticsearch.index.analysis.PreBuiltAnalyzerProviderFactory;
import org.elasticsearch.indices.analysis.IndicesAnalysisService;
public class XAnalysis extends AbstractComponent {
public static String name = "a_name";
@Inject
public XAnalysis(Settings settings,
IndicesAnalysisService indicesAnalysisService) {
super(settings);
indicesAnalysisService.analyzerProviderFactories().put(name,
new PreBuiltAnalyzerProviderFactory(name, AnalyzerScope.INDICES,
new XAnalysis()));
}
}