Skip to content

Commit 747aada

Browse files
Update code samples [skip ci]
1 parent abb38b4 commit 747aada

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

snippets/samples/code_samples_add_or_update_documents_1.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,17 @@ await index.UpdateDocumentsAsync(movie);
8282
#[derive(Serialize, Deserialize)]
8383
struct IncompleteMovie {
8484
id: usize,
85-
title: String
85+
title: String,
86+
genres: String
8687
}
8788

8889
let task: TaskInfo = client
8990
.index("movies")
9091
.add_or_update(&[
9192
IncompleteMovie {
9293
id: 287947,
93-
title: "Shazam ⚡️".to_string()
94+
title: "Shazam ⚡️".to_string(),
95+
genres: "comedy".to_string()
9496
}
9597
], None)
9698
.await

snippets/samples/code_samples_typo_tolerance_guide_2.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ let typo_tolerance = TypoToleranceSettings {
5959
disable_on_words: None,
6060
min_word_size_for_typos: None,
6161
};
62-
6362
let task: TaskInfo = client
6463
.index("movies")
6564
.set_typo_tolerance(&typo_tolerance)

snippets/samples/code_samples_typo_tolerance_guide_5.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,18 @@ client.Index("movies").UpdateTypoTolerance(&meilisearch.TypoTolerance{
4242
DisableOnNumbers: true
4343
})
4444
```
45+
46+
```rust Rust
47+
// Deactivate typo tolerance on numbers and other high entropy words
48+
let typo_tolerance = TypoToleranceSettings {
49+
disable_on_numbers: Some(true),
50+
..Default::default()
51+
};
52+
53+
let task: TaskInfo = client
54+
.index("movies")
55+
.set_typo_tolerance(&typo_tolerance)
56+
.await
57+
.unwrap();
58+
```
4559
</CodeGroup>

0 commit comments

Comments
 (0)