Skip to content

Commit

Permalink
Update code samples
Browse files Browse the repository at this point in the history
  • Loading branch information
iMezemz committed Feb 4, 2024
1 parent 7b857e3 commit 3ac9a0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ update_dictionary_1: |-
client.index("books").updateDictionarySettings(new String[] {"J. R. R.", "W. E. B."});
reset_dictionary_1: |-
client.index("books").resetDictionarySettings();
get_proximity_precision_settings_1: |-
client.index("books").getProximityPrecisionSettings();
update_proximity_precision_settings_1: |-
client.index("books").updateProximityPrecisionSettings("byAttribute");
reset_proximity_precision_settings_1: |-
client.index("books").resetProximityPrecisionSettings();
get_index_stats_1: |-
client.index("movies").getStats();
get_indexes_stats_1: |-
Expand Down
9 changes: 4 additions & 5 deletions src/test/java/com/meilisearch/integration/SettingsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ public void testUpdateProximityPrecisionSettings() throws Exception {
String newProximityPrecision = "byAttribute";

index.waitForTask(
index.updateProximityPrecisionSettings(newProximityPrecision).getTaskUid());
index.updateProximityPrecisionSettings(newProximityPrecision).getTaskUid());
String updatedProximityPrecision = index.getProximityPrecisionSettings();

assertThat(updatedProximityPrecision, is(equalTo(newProximityPrecision)));
Expand All @@ -1123,7 +1123,7 @@ public void testResetProximityPrecisionSettings() throws Exception {
String newProximityPrecision = "byAttribute";

index.waitForTask(
index.updateProximityPrecisionSettings(newProximityPrecision).getTaskUid());
index.updateProximityPrecisionSettings(newProximityPrecision).getTaskUid());
String updatedProximityPrecision = index.getProximityPrecisionSettings();

index.waitForTask(index.resetProximityPrecisionSettings().getTaskUid());
Expand All @@ -1133,13 +1133,12 @@ public void testResetProximityPrecisionSettings() throws Exception {
assertThat(updatedProximityPrecision, is(not(equalTo(initialProximityPrecision))));
assertThat(proximityPrecisionAfterReset, is(not(equalTo(updatedProximityPrecision))));
assertThat(
proximityPrecisionAfterReset,
is(equalTo(initialProximityPrecision))); // Resetting proximity precision
proximityPrecisionAfterReset,
is(equalTo(initialProximityPrecision))); // Resetting proximity precision
// changes it back to the default
// "byWord"
}


private Index createIndex(String indexUid) throws Exception {
Index index = client.index(indexUid);
TaskInfo updateInfo = index.addDocuments(testData.getRaw());
Expand Down

0 comments on commit 3ac9a0e

Please sign in to comment.