Move language analyzers from server to analysis-common module. (#31300)
The following analyzers were moved from server module to analysis-common module: `greek`, `hindi`, `hungarian`, `indonesian`, `irish`, `italian`, `latvian`, `lithuanian`, `norwegian`, `persian`, `portuguese`, `romanian`, `russian`, `sorani`, `spanish`, `swedish`, `turkish` and `thai`. Relates to #23658
This commit is contained in:
parent
f513505052
commit
47095357bc
|
@ -37,6 +37,7 @@ import org.apache.lucene.analysis.charfilter.HTMLStripCharFilter;
|
|||
import org.apache.lucene.analysis.cjk.CJKAnalyzer;
|
||||
import org.apache.lucene.analysis.cjk.CJKBigramFilter;
|
||||
import org.apache.lucene.analysis.cjk.CJKWidthFilter;
|
||||
import org.apache.lucene.analysis.ckb.SoraniAnalyzer;
|
||||
import org.apache.lucene.analysis.ckb.SoraniNormalizationFilter;
|
||||
import org.apache.lucene.analysis.commongrams.CommonGramsFilter;
|
||||
import org.apache.lucene.analysis.core.DecimalDigitFilter;
|
||||
|
@ -52,17 +53,27 @@ import org.apache.lucene.analysis.da.DanishAnalyzer;
|
|||
import org.apache.lucene.analysis.de.GermanAnalyzer;
|
||||
import org.apache.lucene.analysis.de.GermanNormalizationFilter;
|
||||
import org.apache.lucene.analysis.de.GermanStemFilter;
|
||||
import org.apache.lucene.analysis.el.GreekAnalyzer;
|
||||
import org.apache.lucene.analysis.en.EnglishAnalyzer;
|
||||
import org.apache.lucene.analysis.en.KStemFilter;
|
||||
import org.apache.lucene.analysis.en.PorterStemFilter;
|
||||
import org.apache.lucene.analysis.es.SpanishAnalyzer;
|
||||
import org.apache.lucene.analysis.eu.BasqueAnalyzer;
|
||||
import org.apache.lucene.analysis.fa.PersianAnalyzer;
|
||||
import org.apache.lucene.analysis.fa.PersianNormalizationFilter;
|
||||
import org.apache.lucene.analysis.fi.FinnishAnalyzer;
|
||||
import org.apache.lucene.analysis.fr.FrenchAnalyzer;
|
||||
import org.apache.lucene.analysis.ga.IrishAnalyzer;
|
||||
import org.apache.lucene.analysis.gl.GalicianAnalyzer;
|
||||
import org.apache.lucene.analysis.hi.HindiAnalyzer;
|
||||
import org.apache.lucene.analysis.hi.HindiNormalizationFilter;
|
||||
import org.apache.lucene.analysis.hu.HungarianAnalyzer;
|
||||
import org.apache.lucene.analysis.hy.ArmenianAnalyzer;
|
||||
import org.apache.lucene.analysis.id.IndonesianAnalyzer;
|
||||
import org.apache.lucene.analysis.in.IndicNormalizationFilter;
|
||||
import org.apache.lucene.analysis.it.ItalianAnalyzer;
|
||||
import org.apache.lucene.analysis.lt.LithuanianAnalyzer;
|
||||
import org.apache.lucene.analysis.lv.LatvianAnalyzer;
|
||||
import org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter;
|
||||
import org.apache.lucene.analysis.miscellaneous.DisableGraphAttribute;
|
||||
import org.apache.lucene.analysis.miscellaneous.KeywordRepeatFilter;
|
||||
|
@ -79,19 +90,26 @@ import org.apache.lucene.analysis.ngram.EdgeNGramTokenizer;
|
|||
import org.apache.lucene.analysis.ngram.NGramTokenFilter;
|
||||
import org.apache.lucene.analysis.ngram.NGramTokenizer;
|
||||
import org.apache.lucene.analysis.nl.DutchAnalyzer;
|
||||
import org.apache.lucene.analysis.no.NorwegianAnalyzer;
|
||||
import org.apache.lucene.analysis.path.PathHierarchyTokenizer;
|
||||
import org.apache.lucene.analysis.pattern.PatternTokenizer;
|
||||
import org.apache.lucene.analysis.payloads.DelimitedPayloadTokenFilter;
|
||||
import org.apache.lucene.analysis.payloads.TypeAsPayloadTokenFilter;
|
||||
import org.apache.lucene.analysis.pt.PortugueseAnalyzer;
|
||||
import org.apache.lucene.analysis.reverse.ReverseStringFilter;
|
||||
import org.apache.lucene.analysis.ro.RomanianAnalyzer;
|
||||
import org.apache.lucene.analysis.ru.RussianAnalyzer;
|
||||
import org.apache.lucene.analysis.shingle.ShingleFilter;
|
||||
import org.apache.lucene.analysis.snowball.SnowballFilter;
|
||||
import org.apache.lucene.analysis.standard.ClassicFilter;
|
||||
import org.apache.lucene.analysis.standard.ClassicTokenizer;
|
||||
import org.apache.lucene.analysis.standard.StandardAnalyzer;
|
||||
import org.apache.lucene.analysis.standard.UAX29URLEmailTokenizer;
|
||||
import org.apache.lucene.analysis.sv.SwedishAnalyzer;
|
||||
import org.apache.lucene.analysis.th.ThaiAnalyzer;
|
||||
import org.apache.lucene.analysis.th.ThaiTokenizer;
|
||||
import org.apache.lucene.analysis.tr.ApostropheFilter;
|
||||
import org.apache.lucene.analysis.tr.TurkishAnalyzer;
|
||||
import org.apache.lucene.analysis.util.ElisionFilter;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
|
@ -130,6 +148,8 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin {
|
|||
analyzers.put("standard_html_strip", StandardHtmlStripAnalyzerProvider::new);
|
||||
analyzers.put("pattern", PatternAnalyzerProvider::new);
|
||||
analyzers.put("snowball", SnowballAnalyzerProvider::new);
|
||||
|
||||
// Language analyzers:
|
||||
analyzers.put("arabic", ArabicAnalyzerProvider::new);
|
||||
analyzers.put("armenian", ArmenianAnalyzerProvider::new);
|
||||
analyzers.put("basque", BasqueAnalyzerProvider::new);
|
||||
|
@ -147,6 +167,24 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin {
|
|||
analyzers.put("french", FrenchAnalyzerProvider::new);
|
||||
analyzers.put("galician", GalicianAnalyzerProvider::new);
|
||||
analyzers.put("german", GermanAnalyzerProvider::new);
|
||||
analyzers.put("greek", GreekAnalyzerProvider::new);
|
||||
analyzers.put("hindi", HindiAnalyzerProvider::new);
|
||||
analyzers.put("hungarian", HungarianAnalyzerProvider::new);
|
||||
analyzers.put("indonesian", IndonesianAnalyzerProvider::new);
|
||||
analyzers.put("irish", IrishAnalyzerProvider::new);
|
||||
analyzers.put("italian", ItalianAnalyzerProvider::new);
|
||||
analyzers.put("latvian", LatvianAnalyzerProvider::new);
|
||||
analyzers.put("lithuanian", LithuanianAnalyzerProvider::new);
|
||||
analyzers.put("norwegian", NorwegianAnalyzerProvider::new);
|
||||
analyzers.put("persian", PersianAnalyzerProvider::new);
|
||||
analyzers.put("portuguese", PortugueseAnalyzerProvider::new);
|
||||
analyzers.put("romanian", RomanianAnalyzerProvider::new);
|
||||
analyzers.put("russian", RussianAnalyzerProvider::new);
|
||||
analyzers.put("sorani", SoraniAnalyzerProvider::new);
|
||||
analyzers.put("spanish", SpanishAnalyzerProvider::new);
|
||||
analyzers.put("swedish", SwedishAnalyzerProvider::new);
|
||||
analyzers.put("turkish", TurkishAnalyzerProvider::new);
|
||||
analyzers.put("thai", ThaiAnalyzerProvider::new);
|
||||
return analyzers;
|
||||
}
|
||||
|
||||
|
@ -248,13 +286,15 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin {
|
|||
@Override
|
||||
public List<PreBuiltAnalyzerProviderFactory> getPreBuiltAnalyzerProviderFactories() {
|
||||
List<PreBuiltAnalyzerProviderFactory> analyzers = new ArrayList<>();
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("standard_html_strip", CachingStrategy.LUCENE,
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("standard_html_strip", CachingStrategy.ELASTICSEARCH,
|
||||
() -> new StandardHtmlStripAnalyzer(CharArraySet.EMPTY_SET)));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("pattern", CachingStrategy.ELASTICSEARCH,
|
||||
() -> new PatternAnalyzer(Regex.compile("\\W+" /*PatternAnalyzer.NON_WORD_PATTERN*/, null), true,
|
||||
CharArraySet.EMPTY_SET)));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("snowball", CachingStrategy.LUCENE,
|
||||
() -> new SnowballAnalyzer("English", StopAnalyzer.ENGLISH_STOP_WORDS_SET)));
|
||||
|
||||
// Language analyzers:
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("arabic", CachingStrategy.LUCENE, ArabicAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("armenian", CachingStrategy.LUCENE, ArmenianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("basque", CachingStrategy.LUCENE, BasqueAnalyzer::new));
|
||||
|
@ -263,7 +303,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin {
|
|||
analyzers.add(new PreBuiltAnalyzerProviderFactory("bulgarian", CachingStrategy.LUCENE, BulgarianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("catalan", CachingStrategy.LUCENE, CatalanAnalyzer::new));
|
||||
// chinese analyzer: only for old indices, best effort
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("chinese", CachingStrategy.LUCENE, StandardAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("chinese", CachingStrategy.ONE, StandardAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("cjk", CachingStrategy.LUCENE, CJKAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("czech", CachingStrategy.LUCENE, CzechAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("danish", CachingStrategy.LUCENE, DanishAnalyzer::new));
|
||||
|
@ -273,6 +313,24 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin {
|
|||
analyzers.add(new PreBuiltAnalyzerProviderFactory("french", CachingStrategy.LUCENE, FrenchAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("galician", CachingStrategy.LUCENE, GalicianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("german", CachingStrategy.LUCENE, GermanAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("greek", CachingStrategy.LUCENE, GreekAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("hindi", CachingStrategy.LUCENE, HindiAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("hungarian", CachingStrategy.LUCENE, HungarianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("indonesian", CachingStrategy.LUCENE, IndonesianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("irish", CachingStrategy.LUCENE, IrishAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("italian", CachingStrategy.LUCENE, ItalianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("latvian", CachingStrategy.LUCENE, LatvianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("lithuanian", CachingStrategy.LUCENE, LithuanianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("norwegian", CachingStrategy.LUCENE, NorwegianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("persian", CachingStrategy.LUCENE, PersianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("portuguese", CachingStrategy.LUCENE, PortugueseAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("romanian", CachingStrategy.LUCENE, RomanianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("russian", CachingStrategy.LUCENE, RussianAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("sorani", CachingStrategy.LUCENE, SoraniAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("spanish", CachingStrategy.LUCENE, SpanishAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("swedish", CachingStrategy.LUCENE, SwedishAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("turkish", CachingStrategy.LUCENE, TurkishAnalyzer::new));
|
||||
analyzers.add(new PreBuiltAnalyzerProviderFactory("thai", CachingStrategy.LUCENE, ThaiAnalyzer::new));
|
||||
return analyzers;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,18 +17,20 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.el.GreekAnalyzer;
|
||||
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;
|
||||
|
||||
public class GreekAnalyzerProvider extends AbstractIndexAnalyzerProvider<GreekAnalyzer> {
|
||||
|
||||
private final GreekAnalyzer analyzer;
|
||||
|
||||
public GreekAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
GreekAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new GreekAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, GreekAnalyzer.getDefaultStopSet()));
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.hi.HindiAnalyzer;
|
||||
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;
|
||||
|
||||
public class HindiAnalyzerProvider extends AbstractIndexAnalyzerProvider<HindiAnalyzer> {
|
||||
|
||||
private final HindiAnalyzer analyzer;
|
||||
|
||||
public HindiAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
HindiAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new HindiAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, HindiAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.hu.HungarianAnalyzer;
|
||||
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;
|
||||
|
||||
public class HungarianAnalyzerProvider extends AbstractIndexAnalyzerProvider<HungarianAnalyzer> {
|
||||
|
||||
private final HungarianAnalyzer analyzer;
|
||||
|
||||
public HungarianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
HungarianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new HungarianAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, HungarianAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.id.IndonesianAnalyzer;
|
||||
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;
|
||||
|
||||
public class IndonesianAnalyzerProvider extends AbstractIndexAnalyzerProvider<IndonesianAnalyzer> {
|
||||
|
||||
private final IndonesianAnalyzer analyzer;
|
||||
|
||||
public IndonesianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
IndonesianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new IndonesianAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, IndonesianAnalyzer.getDefaultStopSet()),
|
|
@ -17,13 +17,15 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.ga.IrishAnalyzer;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Provider for {@link IrishAnalyzer}
|
||||
|
@ -32,7 +34,7 @@ public class IrishAnalyzerProvider extends AbstractIndexAnalyzerProvider<IrishAn
|
|||
|
||||
private final IrishAnalyzer analyzer;
|
||||
|
||||
public IrishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
IrishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new IrishAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, IrishAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.it.ItalianAnalyzer;
|
||||
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;
|
||||
|
||||
public class ItalianAnalyzerProvider extends AbstractIndexAnalyzerProvider<ItalianAnalyzer> {
|
||||
|
||||
private final ItalianAnalyzer analyzer;
|
||||
|
||||
public ItalianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
ItalianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new ItalianAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, ItalianAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.lv.LatvianAnalyzer;
|
||||
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;
|
||||
|
||||
public class LatvianAnalyzerProvider extends AbstractIndexAnalyzerProvider<LatvianAnalyzer> {
|
||||
|
||||
private final LatvianAnalyzer analyzer;
|
||||
|
||||
public LatvianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
LatvianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new LatvianAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, LatvianAnalyzer.getDefaultStopSet()),
|
|
@ -17,13 +17,15 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.lt.LithuanianAnalyzer;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Provider for {@link LithuanianAnalyzer}
|
||||
|
@ -32,7 +34,7 @@ public class LithuanianAnalyzerProvider extends AbstractIndexAnalyzerProvider<Li
|
|||
|
||||
private final LithuanianAnalyzer analyzer;
|
||||
|
||||
public LithuanianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
LithuanianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new LithuanianAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, LithuanianAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.no.NorwegianAnalyzer;
|
||||
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;
|
||||
|
||||
public class NorwegianAnalyzerProvider extends AbstractIndexAnalyzerProvider<NorwegianAnalyzer> {
|
||||
|
||||
private final NorwegianAnalyzer analyzer;
|
||||
|
||||
public NorwegianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
NorwegianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new NorwegianAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, NorwegianAnalyzer.getDefaultStopSet()),
|
|
@ -17,18 +17,20 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.fa.PersianAnalyzer;
|
||||
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;
|
||||
|
||||
public class PersianAnalyzerProvider extends AbstractIndexAnalyzerProvider<PersianAnalyzer> {
|
||||
|
||||
private final PersianAnalyzer analyzer;
|
||||
|
||||
public PersianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
PersianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new PersianAnalyzer(Analysis.parseStopWords(env, settings, PersianAnalyzer.getDefaultStopSet()));
|
||||
analyzer.setVersion(version);
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.pt.PortugueseAnalyzer;
|
||||
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;
|
||||
|
||||
public class PortugueseAnalyzerProvider extends AbstractIndexAnalyzerProvider<PortugueseAnalyzer> {
|
||||
|
||||
private final PortugueseAnalyzer analyzer;
|
||||
|
||||
public PortugueseAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
PortugueseAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new PortugueseAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, PortugueseAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.ro.RomanianAnalyzer;
|
||||
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;
|
||||
|
||||
public class RomanianAnalyzerProvider extends AbstractIndexAnalyzerProvider<RomanianAnalyzer> {
|
||||
|
||||
private final RomanianAnalyzer analyzer;
|
||||
|
||||
public RomanianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
RomanianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new RomanianAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, RomanianAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.ru.RussianAnalyzer;
|
||||
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;
|
||||
|
||||
public class RussianAnalyzerProvider extends AbstractIndexAnalyzerProvider<RussianAnalyzer> {
|
||||
|
||||
private final RussianAnalyzer analyzer;
|
||||
|
||||
public RussianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
RussianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new RussianAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, RussianAnalyzer.getDefaultStopSet()),
|
|
@ -17,13 +17,15 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.ckb.SoraniAnalyzer;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Provider for {@link SoraniAnalyzer}
|
||||
|
@ -32,7 +34,7 @@ public class SoraniAnalyzerProvider extends AbstractIndexAnalyzerProvider<Sorani
|
|||
|
||||
private final SoraniAnalyzer analyzer;
|
||||
|
||||
public SoraniAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
SoraniAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new SoraniAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, SoraniAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.es.SpanishAnalyzer;
|
||||
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;
|
||||
|
||||
public class SpanishAnalyzerProvider extends AbstractIndexAnalyzerProvider<SpanishAnalyzer> {
|
||||
|
||||
private final SpanishAnalyzer analyzer;
|
||||
|
||||
public SpanishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
SpanishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new SpanishAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, SpanishAnalyzer.getDefaultStopSet()),
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.sv.SwedishAnalyzer;
|
||||
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;
|
||||
|
||||
public class SwedishAnalyzerProvider extends AbstractIndexAnalyzerProvider<SwedishAnalyzer> {
|
||||
|
||||
private final SwedishAnalyzer analyzer;
|
||||
|
||||
public SwedishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
SwedishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new SwedishAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, SwedishAnalyzer.getDefaultStopSet()),
|
|
@ -17,18 +17,20 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.th.ThaiAnalyzer;
|
||||
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;
|
||||
|
||||
public class ThaiAnalyzerProvider extends AbstractIndexAnalyzerProvider<ThaiAnalyzer> {
|
||||
|
||||
private final ThaiAnalyzer analyzer;
|
||||
|
||||
public ThaiAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
ThaiAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new ThaiAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, ThaiAnalyzer.getDefaultStopSet()));
|
|
@ -17,19 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.index.analysis;
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.tr.TurkishAnalyzer;
|
||||
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;
|
||||
|
||||
public class TurkishAnalyzerProvider extends AbstractIndexAnalyzerProvider<TurkishAnalyzer> {
|
||||
|
||||
private final TurkishAnalyzer analyzer;
|
||||
|
||||
public TurkishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
TurkishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, name, settings);
|
||||
analyzer = new TurkishAnalyzer(
|
||||
Analysis.parseStopWords(env, settings, TurkishAnalyzer.getDefaultStopSet()),
|
|
@ -592,3 +592,525 @@
|
|||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: tisch }
|
||||
|
||||
---
|
||||
"greek":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: greek
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: Μία
|
||||
analyzer: greek
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: μια }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: Μία
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: μια }
|
||||
|
||||
---
|
||||
"hindi":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: hindi
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: हिन्दी
|
||||
analyzer: hindi
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: हिंद }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: हिन्दी
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: हिंद }
|
||||
|
||||
---
|
||||
"hungarian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: hungarian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: babakocsi
|
||||
analyzer: hungarian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: babakocs }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: babakocsi
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: babakocs }
|
||||
|
||||
---
|
||||
"indonesian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: indonesian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: peledakan
|
||||
analyzer: indonesian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: ledak }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: peledakan
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: ledak }
|
||||
|
||||
---
|
||||
"irish":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: irish
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: siopadóireacht
|
||||
analyzer: irish
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: siopadóir }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: siopadóireacht
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: siopadóir }
|
||||
|
||||
---
|
||||
"italian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: italian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: abbandonata
|
||||
analyzer: italian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: abbandonat }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: abbandonata
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: abbandonat }
|
||||
|
||||
---
|
||||
"latvian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: latvian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: tirgiem
|
||||
analyzer: latvian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: tirg }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: tirgiem
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: tirg }
|
||||
|
||||
---
|
||||
"lithuanian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: lithuanian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: vaikų
|
||||
analyzer: lithuanian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: vaik }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: vaikų
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: vaik }
|
||||
|
||||
---
|
||||
"norwegian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: norwegian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: havnedistriktene
|
||||
analyzer: norwegian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: havnedistrikt }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: havnedistriktene
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: havnedistrikt }
|
||||
|
||||
---
|
||||
"persian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: persian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: میخورد
|
||||
analyzer: persian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: خورد }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: میخورد
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: خورد }
|
||||
|
||||
---
|
||||
"portuguese":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: portuguese
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: quilométricas
|
||||
analyzer: portuguese
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: quilometric }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: quilométricas
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: quilometric }
|
||||
|
||||
---
|
||||
"romanian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: romanian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: absenţa
|
||||
analyzer: romanian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: absenţ }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: absenţa
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: absenţ }
|
||||
|
||||
---
|
||||
"russian":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: russian
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: Вместе с тем о
|
||||
analyzer: russian
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: вмест }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: Вместе с тем о
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: вмест }
|
||||
|
||||
---
|
||||
"sorani":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: sorani
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: پیاوە
|
||||
analyzer: sorani
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: پیاو }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: پیاوە
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: پیاو }
|
||||
|
||||
---
|
||||
"spanish":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: spanish
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: chicana
|
||||
analyzer: spanish
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: chican }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: chicana
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: chican }
|
||||
|
||||
---
|
||||
"swedish":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: swedish
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: jaktkarlarne
|
||||
analyzer: swedish
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: jaktkarl }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: jaktkarlarne
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: jaktkarl }
|
||||
|
||||
---
|
||||
"turkish":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: turkish
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: ağacı
|
||||
analyzer: turkish
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: ağaç }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: ağacı
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: ağaç }
|
||||
|
||||
---
|
||||
"thai":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
settings:
|
||||
analysis:
|
||||
analyzer:
|
||||
my_analyzer:
|
||||
type: thai
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
body:
|
||||
text: ๑๒๓๔
|
||||
analyzer: thai
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: "1234" }
|
||||
|
||||
- do:
|
||||
indices.analyze:
|
||||
index: test
|
||||
body:
|
||||
text: ๑๒๓๔
|
||||
analyzer: my_analyzer
|
||||
- length: { tokens: 1 }
|
||||
- match: { tokens.0.token: "1234" }
|
||||
|
|
|
@ -30,39 +30,21 @@ import org.elasticsearch.index.IndexSettings;
|
|||
import org.elasticsearch.index.analysis.AnalysisRegistry;
|
||||
import org.elasticsearch.index.analysis.AnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.CharFilterFactory;
|
||||
import org.elasticsearch.index.analysis.GreekAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.HindiAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.HungarianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.HunspellTokenFilterFactory;
|
||||
import org.elasticsearch.index.analysis.IndonesianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.IrishAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.ItalianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.KeywordAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.LatvianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.LithuanianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.NorwegianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.PersianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.PortugueseAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.PreBuiltAnalyzerProviderFactory;
|
||||
import org.elasticsearch.index.analysis.PreConfiguredCharFilter;
|
||||
import org.elasticsearch.index.analysis.PreConfiguredTokenFilter;
|
||||
import org.elasticsearch.index.analysis.PreConfiguredTokenizer;
|
||||
import org.elasticsearch.index.analysis.RomanianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.RussianAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.ShingleTokenFilterFactory;
|
||||
import org.elasticsearch.index.analysis.SimpleAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.SoraniAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.SpanishAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.StandardAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.StandardTokenFilterFactory;
|
||||
import org.elasticsearch.index.analysis.StandardTokenizerFactory;
|
||||
import org.elasticsearch.index.analysis.StopAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.StopTokenFilterFactory;
|
||||
import org.elasticsearch.index.analysis.SwedishAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.ThaiAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.TokenFilterFactory;
|
||||
import org.elasticsearch.index.analysis.TokenizerFactory;
|
||||
import org.elasticsearch.index.analysis.TurkishAnalyzerProvider;
|
||||
import org.elasticsearch.index.analysis.WhitespaceAnalyzerProvider;
|
||||
import org.elasticsearch.plugins.AnalysisPlugin;
|
||||
|
||||
|
@ -227,24 +209,6 @@ public final class AnalysisModule {
|
|||
analyzers.register("stop", StopAnalyzerProvider::new);
|
||||
analyzers.register("whitespace", WhitespaceAnalyzerProvider::new);
|
||||
analyzers.register("keyword", KeywordAnalyzerProvider::new);
|
||||
analyzers.register("greek", GreekAnalyzerProvider::new);
|
||||
analyzers.register("hindi", HindiAnalyzerProvider::new);
|
||||
analyzers.register("hungarian", HungarianAnalyzerProvider::new);
|
||||
analyzers.register("indonesian", IndonesianAnalyzerProvider::new);
|
||||
analyzers.register("irish", IrishAnalyzerProvider::new);
|
||||
analyzers.register("italian", ItalianAnalyzerProvider::new);
|
||||
analyzers.register("latvian", LatvianAnalyzerProvider::new);
|
||||
analyzers.register("lithuanian", LithuanianAnalyzerProvider::new);
|
||||
analyzers.register("norwegian", NorwegianAnalyzerProvider::new);
|
||||
analyzers.register("persian", PersianAnalyzerProvider::new);
|
||||
analyzers.register("portuguese", PortugueseAnalyzerProvider::new);
|
||||
analyzers.register("romanian", RomanianAnalyzerProvider::new);
|
||||
analyzers.register("russian", RussianAnalyzerProvider::new);
|
||||
analyzers.register("sorani", SoraniAnalyzerProvider::new);
|
||||
analyzers.register("spanish", SpanishAnalyzerProvider::new);
|
||||
analyzers.register("swedish", SwedishAnalyzerProvider::new);
|
||||
analyzers.register("turkish", TurkishAnalyzerProvider::new);
|
||||
analyzers.register("thai", ThaiAnalyzerProvider::new);
|
||||
analyzers.extractAndRegister(plugins, AnalysisPlugin::getAnalyzers);
|
||||
return analyzers;
|
||||
}
|
||||
|
|
|
@ -20,30 +20,12 @@ package org.elasticsearch.indices.analysis;
|
|||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.ckb.SoraniAnalyzer;
|
||||
import org.apache.lucene.analysis.core.KeywordAnalyzer;
|
||||
import org.apache.lucene.analysis.core.SimpleAnalyzer;
|
||||
import org.apache.lucene.analysis.core.StopAnalyzer;
|
||||
import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
|
||||
import org.apache.lucene.analysis.el.GreekAnalyzer;
|
||||
import org.apache.lucene.analysis.es.SpanishAnalyzer;
|
||||
import org.apache.lucene.analysis.fa.PersianAnalyzer;
|
||||
import org.apache.lucene.analysis.ga.IrishAnalyzer;
|
||||
import org.apache.lucene.analysis.hi.HindiAnalyzer;
|
||||
import org.apache.lucene.analysis.hu.HungarianAnalyzer;
|
||||
import org.apache.lucene.analysis.id.IndonesianAnalyzer;
|
||||
import org.apache.lucene.analysis.it.ItalianAnalyzer;
|
||||
import org.apache.lucene.analysis.lt.LithuanianAnalyzer;
|
||||
import org.apache.lucene.analysis.lv.LatvianAnalyzer;
|
||||
import org.apache.lucene.analysis.no.NorwegianAnalyzer;
|
||||
import org.apache.lucene.analysis.pt.PortugueseAnalyzer;
|
||||
import org.apache.lucene.analysis.ro.RomanianAnalyzer;
|
||||
import org.apache.lucene.analysis.ru.RussianAnalyzer;
|
||||
import org.apache.lucene.analysis.standard.ClassicAnalyzer;
|
||||
import org.apache.lucene.analysis.standard.StandardAnalyzer;
|
||||
import org.apache.lucene.analysis.sv.SwedishAnalyzer;
|
||||
import org.apache.lucene.analysis.th.ThaiAnalyzer;
|
||||
import org.apache.lucene.analysis.tr.TurkishAnalyzer;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.indices.analysis.PreBuiltCacheFactory.CachingStrategy;
|
||||
|
||||
|
@ -110,168 +92,6 @@ public enum PreBuiltAnalyzers {
|
|||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
GREEK {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new GreekAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
HINDI {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new HindiAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
HUNGARIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new HungarianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
INDONESIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new IndonesianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
IRISH {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new IrishAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
ITALIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new ItalianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
LATVIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new LatvianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
LITHUANIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new LithuanianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
NORWEGIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new NorwegianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
PERSIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new PersianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
PORTUGUESE {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new PortugueseAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
ROMANIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new RomanianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
RUSSIAN {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new RussianAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
SORANI {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new SoraniAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
SPANISH {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new SpanishAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
SWEDISH {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new SwedishAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
TURKISH {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new TurkishAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
},
|
||||
|
||||
THAI {
|
||||
@Override
|
||||
protected Analyzer create(Version version) {
|
||||
Analyzer a = new ThaiAnalyzer();
|
||||
a.setVersion(version.luceneVersion);
|
||||
return a;
|
||||
}
|
||||
};
|
||||
|
||||
protected abstract Analyzer create(Version version);
|
||||
|
|
|
@ -165,7 +165,7 @@ public class AnalysisModuleTests extends ESTestCase {
|
|||
assertEquals(Version.V_5_0_0.luceneVersion,
|
||||
indexAnalyzers.get("standard").analyzer().getVersion());
|
||||
assertEquals(Version.V_5_0_0.luceneVersion,
|
||||
indexAnalyzers.get("thai").analyzer().getVersion());
|
||||
indexAnalyzers.get("stop").analyzer().getVersion());
|
||||
|
||||
assertThat(indexAnalyzers.get("custom7").analyzer(), is(instanceOf(StandardAnalyzer.class)));
|
||||
assertEquals(org.apache.lucene.util.Version.fromBits(3,6,0),
|
||||
|
|
Loading…
Reference in New Issue