@@ -167,7 +167,7 @@ get_attributes_for_faceting_1: |-
167
167
let attributes_for_faceting: Vec<String> = movies.get_attributes_for_faceting().await.unwrap();
168
168
update_attributes_for_faceting_1 : |-
169
169
let attributes_for_faceting = &[
170
- "genre ",
170
+ "genres ",
171
171
"director"
172
172
];
173
173
@@ -287,7 +287,7 @@ search_parameter_guide_crop_1: |-
287
287
.execute()
288
288
.await
289
289
.unwrap();
290
-
290
+
291
291
// Get the formatted results
292
292
let formatted_results: Vec<&Movie> = results.hits.iter().map(|r| r.formatted_result.as_ref().unwrap()).collect();
293
293
search_parameter_guide_highlight_1 : |-
@@ -297,7 +297,7 @@ search_parameter_guide_highlight_1: |-
297
297
.execute()
298
298
.await
299
299
.unwrap();
300
-
300
+
301
301
// Get the formatted results
302
302
let formatted_results: Vec<&Movie> = results.hits.iter().map(|r| r.formatted_result.as_ref().unwrap()).collect();
303
303
search_parameter_guide_filter_1 : |-
@@ -323,7 +323,7 @@ search_parameter_guide_matches_1: |-
323
323
.execute()
324
324
.await
325
325
.unwrap();
326
-
326
+
327
327
// Get the matches info
328
328
let matched_info: Vec<&HashMap<String, Vec<MatchRange>>> = results.hits.iter().map(|r| r.matches_info.as_ref().unwrap()).collect();
329
329
settings_guide_synonyms_1 : |-
@@ -426,7 +426,7 @@ getting_started_create_index_md: |-
426
426
async fn main() {
427
427
let client = Client::new("http://localhost:7700", "masterKey");
428
428
// create an index if the index does not exist
429
- let movies = client.get_or_create("movies").await.unwrap();
429
+ let movies = client.get_or_create("movies").await.unwrap();
430
430
431
431
// some code
432
432
}
@@ -445,14 +445,14 @@ getting_started_add_documents_md: |-
445
445
poster: String,
446
446
overview: String,
447
447
release_date: i64,
448
- genre : Vec<String>
448
+ genres : Vec<String>
449
449
}
450
450
impl Document for Movie {
451
451
type UIDType = String;
452
452
fn get_uid(&self) -> &Self::UIDType { &self.id }
453
453
}
454
454
```
455
-
455
+
456
456
You will often need this `Movie` struct in other parts of this documentation. (you will have to change it a bit sometimes)
457
457
You can also use schemaless values, by putting a `serde_json::Value` inside your own struct like this:
458
458
@@ -479,7 +479,7 @@ getting_started_add_documents_md: |-
479
479
let mut content = String::new();
480
480
file.read_to_string(&mut content).unwrap();
481
481
let movies_docs: Vec<Movie> = serde_json::from_str(&content).unwrap();
482
-
482
+
483
483
// adding documents
484
484
movies.add_documents(&movies_docs, None).await.unwrap();
485
485
```
@@ -489,10 +489,10 @@ getting_started_search_md: |-
489
489
let query: Query = Query::new(&movies)
490
490
.with_query("botman")
491
491
.build();
492
-
492
+
493
493
let results: SearchResults<Movie> = movies.execute_query(&query).await.unwrap();
494
494
```
495
-
495
+
496
496
You can build a Query and execute it directly:
497
497
```rust
498
498
let results: SearchResults<Movie> = Query::new(&movies)
@@ -511,7 +511,7 @@ getting_started_search_md: |-
511
511
.unwrap();
512
512
```
513
513
faceted_search_update_settings_1 : |-
514
- let progress: Progress = movies.set_attributes_for_faceting(&["director", "genre "]).await.unwrap();
514
+ let progress: Progress = movies.set_attributes_for_faceting(&["director", "genres "]).await.unwrap();
515
515
faceted_search_facet_filters_1 : |-
516
516
let results: SearchResults<Movie> = movies.search()
517
517
.with_query("thriller")
0 commit comments