@@ -423,25 +423,27 @@ documents_guide_add_movie_1: |-
423
423
title: "Amélie Poulain".to_string(),
424
424
}
425
425
], None).await.unwrap();
426
- document_guide_create_index_primary_key : |-
427
- client.create_index("movies", Some("reference_number")).await.unwrap();
428
- document_guide_add_document_primary_key : |-
426
+ primary_field_guide_update_document_primary_key : |-
427
+ client.index("books").update("title").await.unwrap();
428
+ primary_field_guide_create_index_primary_key : |-
429
+ client.create_index("books", Some("reference_number")).await.unwrap();
430
+ primary_field_guide_add_document_primary_key : |-
429
431
#[derive(Serialize, Deserialize)]
430
- struct Movie {
431
- id : String,
432
+ struct Book {
433
+ reference_number : String,
432
434
title: String,
433
- poster : String,
434
- overview: String,
435
- release_date: String
435
+ author : String,
436
+ genres: Vec< String> ,
437
+ price: f64
436
438
}
437
439
438
- let task: Task = client.index("movies ").add_documents(&[
439
- Movie {
440
+ let task: Task = client.index("books ").add_documents(&[
441
+ Book {
440
442
reference_number: "287947".to_string(),
441
- title: "Shazam ".to_string(),
442
- poster : "https://image.tmdb.org/t/p/w1280/xnopI5Xtky18MPhK40cZAGAOVeV.jpg ".to_string(),
443
- overview: "A boy is given the ability to become an adult superhero in times of need with a single magic word." .to_string(),
444
- release_date: "2019-03-23".to_string()
443
+ title: "Diary of a Wimpy Kid ".to_string(),
444
+ author : "Jeff Kinney ".to_string(),
445
+ genres: vec!["comedy".to_string(),"humor" .to_string()] ,
446
+ price: 5.00
445
447
}
446
448
], Some("reference_number")).await.unwrap();
447
449
getting_started_add_documents_md : |-
@@ -539,7 +541,7 @@ getting_started_search_md: |-
539
541
```
540
542
541
543
[About this SDK](https://github.com/meilisearch/meilisearch-rust/)
542
- getting_started_update_rankingRules : |-
544
+ getting_started_update_ranking_rules : |-
543
545
let ranking_rules = [
544
546
"exactness",
545
547
"words",
@@ -552,7 +554,7 @@ getting_started_update_rankingRules: |-
552
554
];
553
555
554
556
client.index("movies").set_ranking_rules(&ranking_rules).await.unwrap();
555
- getting_started_update_searchableAttributes : |-
557
+ getting_started_update_searchable_attributes : |-
556
558
let searchable_attributes = [
557
559
"title"
558
560
];
@@ -569,7 +571,7 @@ getting_started_synonyms: |-
569
571
synonyms.insert(String::from("piglet"), vec![String::from("winnie")]);
570
572
571
573
client.index("movies").set_synonyms(&synonyms).await.unwrap();
572
- getting_started_update_displayedAttributes : |-
574
+ getting_started_update_displayed_attributes : |-
573
575
let displayed_attributes = [
574
576
"title",
575
577
"overview",
@@ -615,13 +617,13 @@ getting_started_configure_settings: |-
615
617
"geo"
616
618
])
617
619
let task: Task = client.index("meteorites").set_settings(&settings).await.unwrap();
618
- getting_started_geoRadius : |-
620
+ getting_started_geo_radius : |-
619
621
let results: SearchResults<Meteorite> = client.index("meteorites").search()
620
622
.with_filter("_geoRadius(46.9480, 7.4474, 210000)")
621
623
.execute()
622
624
.await
623
625
.unwrap();
624
- getting_started_geoPoint : |-
626
+ getting_started_geo_point : |-
625
627
let results: SearchResults<Meteorite> = client.index("meteorites").search()
626
628
.with_sort(&["_geoPoint(48.8583701, 2.2922926):asc"])
627
629
.execute()
0 commit comments