]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11792 drop setting index.mapper.dynamic
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 11 Mar 2019 13:45:56 +0000 (14:45 +0100)
committerSonarTech <sonartech@sonarsource.com>
Tue, 19 Mar 2019 19:21:25 +0000 (20:21 +0100)
server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/DefaultIndexSettings.java
server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/NewIndex.java
server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewIndexTest.java

index aaf2b2e2d64583f67a7b403c892f578d3311620d..4dddc71dd8d9492db04e1f5aa69945040f16b35d 100644 (file)
@@ -83,8 +83,7 @@ public class DefaultIndexSettings {
   public static Settings.Builder defaults() {
     Settings.Builder builder = Settings.builder()
       .put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
-      .put("index.refresh_interval", "30s")
-      .put("index.mapper.dynamic", false);
+      .put("index.refresh_interval", "30s");
 
     Arrays.stream(DefaultIndexSettingsElement.values())
       .map(DefaultIndexSettingsElement::settings)
index f608b9b316386f92c46ef8950c96571d7fbebb51..43ce95471dee300340941b20a791890860852193 100644 (file)
@@ -55,7 +55,6 @@ public abstract class NewIndex<T extends NewIndex<T>> {
   }
 
   private void applySettingsConfiguration(SettingsConfiguration settingsConfiguration) {
-    settings.put("index.mapper.dynamic", valueOf(false));
     settings.put("index.refresh_interval", refreshInterval(settingsConfiguration));
 
     Configuration config = settingsConfiguration.getConfiguration();
index 960ac5657589c42d5582f2c46d2e4f4fe56573dc..4f50be5e81cf111264e5f6bec90b9be7f50db8ef 100644 (file)
@@ -68,7 +68,8 @@ public class NewIndexTest {
       .getSettings().build();
 
     assertThat(underTest.get("index.number_of_shards")).isNotEmpty();
-    assertThat(underTest.get("index.mapper.dynamic")).isEqualTo("false");
+    // index.mapper.dynamic is deprecated and should not be set anymore
+    assertThat(underTest.get("index.mapper.dynamic")).isNull();
     assertThat(underTest.get("index.refresh_interval")).isEqualTo("30s");
     // setting "mapping.single_type" has been dropped in 6.X because multi type indices are not supported anymore
     assertThat(underTest.get("mapping.single_type")).isNull();
@@ -83,7 +84,8 @@ public class NewIndexTest {
     Settings underTest = new SimplestNewIndex(IndexType.main(index, "foo"), defaultSettingsConfiguration).getSettings().build();
 
     assertThat(underTest.get("index.number_of_shards")).isNotEmpty();
-    assertThat(underTest.get("index.mapper.dynamic")).isEqualTo("false");
+    // index.mapper.dynamic is deprecated and should not be set anymore
+    assertThat(underTest.get("index.mapper.dynamic")).isNull();
     assertThat(underTest.get("index.refresh_interval")).isEqualTo("30s");
     // setting "mapping.single_type" has been dropped in 6.X because multi type indices are not supported anymore
     assertThat(underTest.get("mapping.single_type")).isNull();