Skip to content

Commit 8a976a4

Browse files
committed
Change disableOnNumbers to nullable Boolean for partial updates
1 parent 299831a commit 8a976a4

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

.code-samples.meilisearch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ typo_tolerance_guide_4: |-
455455
typo_tolerance_guide_5: |-
456456
TypoTolerance typoTolerance = new TypoTolerance();
457457
typoTolerance.setDisableOnNumbers(true);
458-
client.index("1917").updateTypoToleranceSettings(typoTolerance);
458+
client.index("movies").updateTypoToleranceSettings(typoTolerance);
459459
getting_started_add_documents: |-
460460
// For Maven:
461461
// Add the following code to the `<dependencies>` section of your project:

src/main/java/com/meilisearch/sdk/model/TypoTolerance.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class TypoTolerance {
1919
protected HashMap<String, Integer> minWordSizeForTypos;
2020
protected String[] disableOnWords;
2121
protected String[] disableOnAttributes;
22-
protected boolean disableOnNumbers;
22+
protected Boolean disableOnNumbers;
2323

2424
public TypoTolerance() {}
2525
}

src/test/java/com/meilisearch/integration/SettingsTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -904,18 +904,16 @@ public void testResetTypoTolerance() throws Exception {
904904
@DisplayName("Test update disableOnNumbers tolerance settings")
905905
public void testUpdateDisableOnNumbersTolerance() throws Exception {
906906
Index index = createIndex("testUpdateDisableOnNumbers");
907-
908-
TypoTolerance newTypoTolerance = new TypoTolerance();
909-
index.waitForTask(index.updateTypoToleranceSettings(newTypoTolerance).getTaskUid());
910-
TypoTolerance updatedTypoToleranceDefault = index.getTypoToleranceSettings();
907+
TypoTolerance defaultTypoTolerance = index.getTypoToleranceSettings();
911908

912909
TypoTolerance newTypoToleranceDisableOnNumbers = new TypoTolerance();
913910
newTypoToleranceDisableOnNumbers.setDisableOnNumbers(true);
914-
index.waitForTask(index.updateTypoToleranceSettings(newTypoToleranceDisableOnNumbers).getTaskUid());
915-
TypoTolerance updatedTypoToleranceDisableOnNumbers = index.getTypoToleranceSettings();
911+
index.waitForTask(
912+
index.updateTypoToleranceSettings(newTypoToleranceDisableOnNumbers).getTaskUid());
913+
TypoTolerance updatedTypoTolerance = index.getTypoToleranceSettings();
916914

917-
assertThat(updatedTypoToleranceDefault.isDisableOnNumbers(), is(equalTo(false)));
918-
assertThat(updatedTypoToleranceDisableOnNumbers.isDisableOnNumbers(), is(equalTo(true)));
915+
assertThat(defaultTypoTolerance.getDisableOnNumbers(), is(equalTo(false)));
916+
assertThat(updatedTypoTolerance.getDisableOnNumbers(), is(equalTo(true)));
919917
}
920918

921919
/** Tests of all the specifics setting methods when null is passed */

0 commit comments

Comments
 (0)