diff --git a/src/test/java/org/elasticsearch/index/analysis/PolishAnalysisTests.java b/src/test/java/org/elasticsearch/index/analysis/PolishAnalysisTests.java index 071921d8525..7647e5c6a4d 100644 --- a/src/test/java/org/elasticsearch/index/analysis/PolishAnalysisTests.java +++ b/src/test/java/org/elasticsearch/index/analysis/PolishAnalysisTests.java @@ -21,8 +21,11 @@ package org.elasticsearch.index.analysis; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.pl.PolishAnalyzer; +import org.elasticsearch.Version; +import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.inject.Injector; import org.elasticsearch.common.inject.ModulesBuilder; +import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.env.Environment; import org.elasticsearch.env.EnvironmentModule; @@ -38,6 +41,7 @@ import org.hamcrest.MatcherAssert; import org.junit.Test; import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS; +import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder; import static org.hamcrest.Matchers.instanceOf; /** @@ -47,10 +51,13 @@ public class PolishAnalysisTests extends ElasticsearchTestCase { @Test public void testDefaultsPolishAnalysis() { Index index = new Index("test"); + Settings settings = settingsBuilder() + .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT) + .build(); Injector parentInjector = new ModulesBuilder().add(new SettingsModule(EMPTY_SETTINGS), new EnvironmentModule(new Environment(EMPTY_SETTINGS)), new IndicesAnalysisModule()).createInjector(); Injector injector = new ModulesBuilder().add( - new IndexSettingsModule(index, EMPTY_SETTINGS), + new IndexSettingsModule(index, settings), new IndexNameModule(index), new AnalysisModule(EMPTY_SETTINGS, parentInjector.getInstance(IndicesAnalysisService.class)).addProcessor(new PolishAnalysisBinderProcessor())) .createChildInjector(parentInjector); diff --git a/src/test/java/org/elasticsearch/index/analysis/SimplePolishTokenFilterTests.java b/src/test/java/org/elasticsearch/index/analysis/SimplePolishTokenFilterTests.java index 17f54052fda..5b71cdd29a8 100644 --- a/src/test/java/org/elasticsearch/index/analysis/SimplePolishTokenFilterTests.java +++ b/src/test/java/org/elasticsearch/index/analysis/SimplePolishTokenFilterTests.java @@ -23,6 +23,8 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.core.KeywordTokenizer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; +import org.elasticsearch.Version; +import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.inject.Injector; import org.elasticsearch.common.inject.ModulesBuilder; import org.elasticsearch.common.settings.ImmutableSettings; @@ -59,6 +61,7 @@ public class SimplePolishTokenFilterTests extends ElasticsearchTestCase { private void testToken(String source, String expected) throws IOException { Index index = new Index("test"); Settings settings = ImmutableSettings.settingsBuilder() + .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT) .put("index.analysis.filter.myStemmer.type", "polish_stem") .build(); AnalysisService analysisService = createAnalysisService(index, settings); @@ -76,7 +79,9 @@ public class SimplePolishTokenFilterTests extends ElasticsearchTestCase { private void testAnalyzer(String source, String... expected_terms) throws IOException { Index index = new Index("test"); - Settings settings = ImmutableSettings.settingsBuilder().build(); + Settings settings = ImmutableSettings.settingsBuilder() + .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT) + .build(); AnalysisService analysisService = createAnalysisService(index, settings); Analyzer analyzer = analysisService.analyzer("polish").analyzer();