6
6
get_one_index_1 : |-
7
7
let movies: Index = client.get_index("movies").await.unwrap();
8
8
list_all_indexes_1 : |-
9
- let indexes: IndexesResults = client.list_all_indexes().await.unwrap();
9
+ let mut indexes = IndexesQuery::new(&client)
10
+ .with_limit(3)
11
+ .execute().await.unwrap();
10
12
create_an_index_1 : |-
11
13
client.create_index("movies", Some("id")).await.unwrap();
12
14
update_an_index_1 : |-
13
15
client.index("movies").update("movie_review_id").await.unwrap();
14
16
delete_an_index_1 : |-
15
17
client.index("movies").delete().await.unwrap();
16
18
get_one_document_1 : |-
17
- let movie: Movie = client.index("movies").get_document(String::from("25684")).await.unwrap();
19
+ let document_query = DocumentQuery::new(&index)
20
+ .with_fields(["id", "title", "poster", "release_date"])
21
+ .execute::<Movie>("25684")
22
+ .await
23
+ .unwrap()
18
24
get_documents_1 : |-
19
25
let documents: Vec<Movie> = client.index("movies").get_documents(None, Some(2), None).await.unwrap();
20
26
add_or_replace_documents_1 : |-
@@ -54,16 +60,40 @@ search_post_1: |-
54
60
.execute()
55
61
.await
56
62
.unwrap();
57
- get_task_by_index_1 : |-
58
- let task: Task = client.index("movies").get_task(1).await.unwrap();
59
- get_all_tasks_by_index_1 : |-
60
- let tasks: TasksResults = client.index("movies").get_tasks().await.unwrap();
61
63
get_all_tasks_1 : |-
62
64
let tasks: TasksResults = client.get_tasks().await.unwrap();
65
+ get_all_tasks_filtering_1 : |-
66
+ let mut query = TasksQuery::new(&client)
67
+ .with_index_uid(["movies"])
68
+ .execute()
69
+ .await
70
+ .unwrap();
71
+ get_all_tasks_filtering_2 : |-
72
+ let mut query = TasksQuery::new(&client)
73
+ .with_status(["succeeded", "failed"])
74
+ .with_type(["documentAdditionOrUpdate"])
75
+ .execute()
76
+ .await
77
+ .unwrap();
78
+ get_all_tasks_paginating_1 : |-
79
+ let mut query = TasksQuery::new(&client)
80
+ .with_limit(2)
81
+ .with_from(10)
82
+ .execute()
83
+ .await
84
+ .unwrap();
85
+ get_all_tasks_paginating_2 : |-
86
+ let mut query = TasksQuery::new(&client)
87
+ .with_limit(2)
88
+ .from(8)
89
+ .execute()
90
+ .await
91
+ .unwrap();
63
92
get_task_1 : |-
64
93
let task: Task = client.get_task(1).await.unwrap();
65
94
get_settings_1 : |-
66
95
let settings: Settings = client.index("movies").get_settings().await.unwrap();
96
+ # Cannot be updated until API faceting and pagination are added
67
97
update_settings_1 : |-
68
98
let mut synonyms = std::collections::HashMap::new();
69
99
synonyms.insert(String::from("wolverine"), vec!["xmen", "logan"]);
@@ -303,7 +333,7 @@ search_parameter_guide_highlight_tag_1: |-
303
333
304
334
// Get the formatted results
305
335
let formatted_results: Vec<&Movie> = results.hits.iter().map(|r| r.formatted_result.as_ref().unwrap()).collect();
306
- search_parameter_guide_matches_1 : |-
336
+ search_parameter_guide_show_matches_position_1 : |-
307
337
let results: SearchResults<Movie> = client.index("movies").search()
308
338
.with_query("winter feast")
309
339
.with_show_matches_position(true)
@@ -312,7 +342,7 @@ search_parameter_guide_matches_1: |-
312
342
.unwrap();
313
343
314
344
// Get the matches info
315
- let matched_info : Vec<&HashMap<String, Vec<MatchRange>>> = results.hits.iter().map(|r| r.matches_position.as_ref().unwrap()).collect();
345
+ let matches_position : Vec<&HashMap<String, Vec<MatchRange>>> = results.hits.iter().map(|r| r.matches_position.as_ref().unwrap()).collect();
316
346
settings_guide_synonyms_1 : |-
317
347
let mut synonyms = HashMap::new();
318
348
synonyms.insert(String::from("sweater"), vec![String::from("jumper")]);
@@ -564,7 +594,7 @@ getting_started_update_stop_words: |-
564
594
let stop_words = ["the"];
565
595
client.index("movies").set_stop_words(&stop_words).await.unwrap();
566
596
getting_started_check_task_status : |-
567
- client.index("movies"). get_task(0).await.unwrap();
597
+ client.get_task(0).await.unwrap();
568
598
getting_started_synonyms : |-
569
599
let mut synonyms = std::collections::HashMap::new();
570
600
synonyms.insert(String::from("winnie"), vec![String::from("piglet")]);
@@ -651,7 +681,7 @@ faceted_search_filter_1: |-
651
681
.execute()
652
682
.await
653
683
.unwrap();
654
- faceted_search_facets_distribution_1 : |-
684
+ faceted_search_facets_1 : |-
655
685
let results: SearchResults<Movie> = client.index("movies").search()
656
686
.with_query("Batman")
657
687
.with_facets(Selectors::Some(&["genres"]))
@@ -754,26 +784,26 @@ geosearch_guide_sort_usage_2: |-
754
784
.await
755
785
.unwrap();
756
786
get_one_key_1 : |-
757
- let key = client.get_key("d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4 ").await.unwrap();
787
+ let key = client.get_key("6062abda-a5aa-4414-ac91-ecd7944c0f8d ").await.unwrap();
758
788
get_all_keys_1 : |-
759
- let keys = client.get_keys( ).await.unwrap();
789
+ let mut query = KeysQuery::new().with_limit(3).execute(&client ).await.unwrap();
760
790
create_a_key_1 : |-
761
791
let mut key_options = KeyBuilder::new("Add documents: Products API key");
762
792
key_options.with_action(Action::DocumentsAdd)
763
793
.with_expires_at(time::macros::datetime!(2042 - 04 - 02 00:42:42 UTC))
764
794
.with_index("products");
765
795
let new_key = client.create_key(key_options).await.unwrap();
766
796
update_a_key_1 : |-
767
- let mut key = client.get_key("d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4 ").await.unwrap();
797
+ let mut key = client.get_key("6062abda-a5aa-4414-ac91-ecd7944c0f8d ").await.unwrap();
768
798
key
769
799
.with_description("Manage documents: Products/Reviews API key".to_string())
770
- .with_actions(vec![Action::DocumentsAdd, Action::DocumentsDelete] )
771
- .with_indexes(vec!["products".to_string(), "reviews".to_string()] )
772
- .with_expires_at(time::macros::datetime!(2042 - 04 - 02 00:42:42 UTC))
773
- .update(&client );
800
+ .with_name("Products/Reviews API key".to_string() )
801
+ .update(&client )
802
+ .await
803
+ .unwrap( );
774
804
delete_a_key_1 : |-
775
- let key = client.get_key("d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4 ").await.unwrap();
776
- client.delete_key(&key);
805
+ let key = client.get_key("6062abda-a5aa-4414-ac91-ecd7944c0f8d ").await.unwrap();
806
+ client.delete_key(&key).await? ;
777
807
authorization_header_1 :
778
808
let client = Client::new("http://localhost:7700", "masterKey");
779
809
let keys = client.get_keys().await.unwrap();
@@ -782,8 +812,8 @@ security_guide_search_key_1: |-
782
812
let result = client.index("patient_medical_records").search().execute().await.unwrap();
783
813
security_guide_update_key_1 : |-
784
814
let client = Client::new("http://localhost:7700", "masterKey");
785
- let mut key = client.get_key("d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4 ").await.unwrap();
786
- key.with_indexes(vec!["doctors ".to_string()] ).update(&client);
815
+ let mut key = client.get_key("74c9c733-3368-4738-bbe5-1d18a5fecb37 ").await.unwrap();
816
+ key.with_description("Default Search API key ".to_string()).update(&client);
787
817
security_guide_create_key_1 : |-
788
818
let client = Client::new("http://localhost:7700", "masterKey");
789
819
let mut key_options = KeyBuilder::new("Search patient records key");
@@ -796,8 +826,8 @@ security_guide_list_keys_1: |-
796
826
let keys = client.get_keys().await.unwrap();
797
827
security_guide_delete_key_1 : |-
798
828
let client = Client::new("http://localhost:7700", "masterKey");
799
- let key = client.get_key("d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4 ").await.unwrap();
800
- client.delete_key(&key);
829
+ let key = client.get_key("ac5cd97d-5a4b-4226-a868-2d0eb6d197ab ").await.unwrap();
830
+ client.delete_key(&key).await? ;
801
831
landing_getting_started_1 : |-
802
832
let client = Client::new("http://localhost:7700", "masterKey");
803
833
0 commit comments