File tree Expand file tree Collapse file tree
main/java/com/meilisearch/sdk/model
test/java/com/meilisearch/integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -452,6 +452,10 @@ typo_tolerance_guide_4: |-
452452 };
453453 typoTolerance.setMinWordSizeForTypos(minWordSizeTypos);
454454 client.index("movies").updateTypoToleranceSettings(typoTolerance);
455+ typo_tolerance_guide_5 : |-
456+ TypoTolerance typoTolerance = new TypoTolerance();
457+ typoTolerance.setDisableOnNumbers(true);
458+ client.index("movies").updateTypoToleranceSettings(typoTolerance);
455459getting_started_add_documents : |-
456460 // For Maven:
457461 // Add the following code to the `<dependencies>` section of your project:
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public class TypoTolerance {
1919 protected HashMap <String , Integer > minWordSizeForTypos ;
2020 protected String [] disableOnWords ;
2121 protected String [] disableOnAttributes ;
22+ protected Boolean disableOnNumbers ;
2223
2324 public TypoTolerance () {}
2425}
Original file line number Diff line number Diff line change @@ -900,6 +900,22 @@ public void testResetTypoTolerance() throws Exception {
900900 is (notNullValue ()));
901901 }
902902
903+ @ Test
904+ @ DisplayName ("Test update disableOnNumbers tolerance settings" )
905+ public void testUpdateDisableOnNumbersTolerance () throws Exception {
906+ Index index = createIndex ("testUpdateDisableOnNumbers" );
907+ TypoTolerance defaultTypoTolerance = index .getTypoToleranceSettings ();
908+
909+ TypoTolerance newTypoToleranceDisableOnNumbers = new TypoTolerance ();
910+ newTypoToleranceDisableOnNumbers .setDisableOnNumbers (true );
911+ index .waitForTask (
912+ index .updateTypoToleranceSettings (newTypoToleranceDisableOnNumbers ).getTaskUid ());
913+ TypoTolerance updatedTypoTolerance = index .getTypoToleranceSettings ();
914+
915+ assertThat (defaultTypoTolerance .getDisableOnNumbers (), is (equalTo (false )));
916+ assertThat (updatedTypoTolerance .getDisableOnNumbers (), is (equalTo (true )));
917+ }
918+
903919 /** Tests of all the specifics setting methods when null is passed */
904920 @ Test
905921 @ DisplayName ("Test update synonyms settings when null is passed" )
You can’t perform that action at this time.
0 commit comments