@@ -193,10 +193,8 @@ get_index_stats_1: |-
193
193
get_indexes_stats_1 : |-
194
194
let stats: ClientStats = client.get_stats().await.unwrap();
195
195
get_health_1 : |-
196
- // get_health() return an Err() if the server is not healthy, so this example would panic due to the unwrap
197
- client.get_health().await.unwrap();
198
- update_health_1 : |-
199
- client.set_health(false).await.unwrap();
196
+ // health() return an Err() if the server is not healthy, so this example would panic due to the unwrap
197
+ client.health().await.unwrap();
200
198
get_version_1 : |-
201
199
let version: Version = client.get_version().await.unwrap();
202
200
distinct_attribute_guide_1 : |-
@@ -287,7 +285,7 @@ search_parameter_guide_crop_1: |-
287
285
.execute()
288
286
.await
289
287
.unwrap();
290
-
288
+
291
289
// Get the formatted results
292
290
let formatted_results: Vec<&Movie> = results.hits.iter().map(|r| r.formatted_result.as_ref().unwrap()).collect();
293
291
search_parameter_guide_highlight_1 : |-
@@ -297,7 +295,7 @@ search_parameter_guide_highlight_1: |-
297
295
.execute()
298
296
.await
299
297
.unwrap();
300
-
298
+
301
299
// Get the formatted results
302
300
let formatted_results: Vec<&Movie> = results.hits.iter().map(|r| r.formatted_result.as_ref().unwrap()).collect();
303
301
search_parameter_guide_filter_1 : |-
@@ -323,7 +321,7 @@ search_parameter_guide_matches_1: |-
323
321
.execute()
324
322
.await
325
323
.unwrap();
326
-
324
+
327
325
// Get the matches info
328
326
let matched_info: Vec<&HashMap<String, Vec<MatchRange>>> = results.hits.iter().map(|r| r.matches_info.as_ref().unwrap()).collect();
329
327
settings_guide_synonyms_1 : |-
@@ -426,7 +424,7 @@ getting_started_create_index_md: |-
426
424
async fn main() {
427
425
let client = Client::new("http://localhost:7700", "masterKey");
428
426
// create an index if the index does not exist
429
- let movies = client.get_or_create("movies").await.unwrap();
427
+ let movies = client.get_or_create("movies").await.unwrap();
430
428
431
429
// some code
432
430
}
@@ -452,7 +450,7 @@ getting_started_add_documents_md: |-
452
450
fn get_uid(&self) -> &Self::UIDType { &self.id }
453
451
}
454
452
```
455
-
453
+
456
454
You will often need this `Movie` struct in other parts of this documentation. (you will have to change it a bit sometimes)
457
455
You can also use schemaless values, by putting a `serde_json::Value` inside your own struct like this:
458
456
@@ -479,7 +477,7 @@ getting_started_add_documents_md: |-
479
477
let mut content = String::new();
480
478
file.read_to_string(&mut content).unwrap();
481
479
let movies_docs: Vec<Movie> = serde_json::from_str(&content).unwrap();
482
-
480
+
483
481
// adding documents
484
482
movies.add_documents(&movies_docs, None).await.unwrap();
485
483
```
@@ -489,10 +487,10 @@ getting_started_search_md: |-
489
487
let query: Query = Query::new(&movies)
490
488
.with_query("botman")
491
489
.build();
492
-
490
+
493
491
let results: SearchResults<Movie> = movies.execute_query(&query).await.unwrap();
494
492
```
495
-
493
+
496
494
You can build a Query and execute it directly:
497
495
```rust
498
496
let results: SearchResults<Movie> = Query::new(&movies)
0 commit comments