diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2019-03-11 15:42:11 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-03-19 20:21:25 +0100 |
commit | 4112b9f541ac22cdc8153896ebf3213af39c1ef0 (patch) | |
tree | 28849f452c566dcb9482f758d81ef92c8d49ba83 /server/sonar-server-common | |
parent | fc39be58b09d3c98a8a04f71b0244916f1358ab3 (diff) | |
download | sonarqube-4112b9f541ac22cdc8153896ebf3213af39c1ef0.tar.gz sonarqube-4112b9f541ac22cdc8153896ebf3213af39c1ef0.zip |
SONAR-11792 change default max_ngram_diff to 13
Diffstat (limited to 'server/sonar-server-common')
-rw-r--r-- | server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/NewIndex.java | 1 | ||||
-rw-r--r-- | server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewIndexTest.java | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/NewIndex.java b/server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/NewIndex.java index 84c50d63487..3b47514f6cf 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/NewIndex.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/es/newindex/NewIndex.java @@ -65,6 +65,7 @@ public abstract class NewIndex<T extends NewIndex<T>> { settings.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, shards); settings.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, replicas); + settings.put("index.max_ngram_diff", DefaultIndexSettings.MAXIMUM_NGRAM_LENGTH - DefaultIndexSettings.MINIMUM_NGRAM_LENGTH); } private void configureDefaultAttributes() { diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewIndexTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewIndexTest.java index 4db0c2b9be4..835fe681d4c 100644 --- a/server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewIndexTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewIndexTest.java @@ -84,6 +84,7 @@ public class NewIndexTest { assertThat(underTest.get("mapping.single_type")).isNull(); assertThat(underTest.get("index.number_of_shards")).isEqualTo("1"); assertThat(underTest.get("index.number_of_replicas")).isEqualTo("0"); + assertThat(underTest.get("index.max_ngram_diff")).isEqualTo("13"); } @Test @@ -100,6 +101,7 @@ public class NewIndexTest { assertThat(underTest.get("mapping.single_type")).isNull(); assertThat(underTest.get("index.number_of_shards")).isEqualTo("1"); assertThat(underTest.get("index.number_of_replicas")).isEqualTo("1"); + assertThat(underTest.get("index.max_ngram_diff")).isEqualTo("13"); } @Test |