aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2019-03-11 15:42:11 +0100
committerSonarTech <sonartech@sonarsource.com>2019-03-19 20:21:25 +0100
commit4112b9f541ac22cdc8153896ebf3213af39c1ef0 (patch)
tree28849f452c566dcb9482f758d81ef92c8d49ba83 /server/sonar-server-common
parentfc39be58b09d3c98a8a04f71b0244916f1358ab3 (diff)
downloadsonarqube-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.java1
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/es/newindex/NewIndexTest.java2
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