Search in sources :

Example 1 with PolishStemTokenFilterFactory

use of org.elasticsearch.index.analysis.pl.PolishStemTokenFilterFactory in project elasticsearch by elastic.

the class AnalysisPolishFactoryTests method testThreadSafety.

public void testThreadSafety() throws IOException {
    // TODO: is this the right boilerplate?  I forked this out of TransportAnalyzeAction.java:
    Settings settings = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0).put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetaData.SETTING_INDEX_UUID, UUIDs.randomBase64UUID()).put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString()).build();
    Environment environment = new Environment(settings);
    IndexMetaData metaData = IndexMetaData.builder(IndexMetaData.INDEX_UUID_NA_VALUE).settings(settings).build();
    IndexSettings indexSettings = new IndexSettings(metaData, Settings.EMPTY);
    testThreadSafety(new PolishStemTokenFilterFactory(indexSettings, environment, "stempelpolishstem", settings));
}
Also used : IndexSettings(org.elasticsearch.index.IndexSettings) Environment(org.elasticsearch.env.Environment) PolishStemTokenFilterFactory(org.elasticsearch.index.analysis.pl.PolishStemTokenFilterFactory) Settings(org.elasticsearch.common.settings.Settings) IndexSettings(org.elasticsearch.index.IndexSettings) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData)

Aggregations

IndexMetaData (org.elasticsearch.cluster.metadata.IndexMetaData)1 Settings (org.elasticsearch.common.settings.Settings)1 Environment (org.elasticsearch.env.Environment)1 IndexSettings (org.elasticsearch.index.IndexSettings)1 PolishStemTokenFilterFactory (org.elasticsearch.index.analysis.pl.PolishStemTokenFilterFactory)1