Skip to content

Commit 0eb59ed

Browse files
committed
update the code samples
1 parent c263d26 commit 0eb59ed

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.code-samples.meilisearch.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ add_movies_json_1: |-
779779
use futures::executor::block_on;
780780
781781
fn main() { block_on(async move {
782-
let client = Client::new("http://localhost:7700", "masterKey");
782+
let client = Client::new("http://localhost:7700", Some("masterKey"));
783783
784784
// reading and parsing the file
785785
let mut file = File::open("movies.json")
@@ -903,7 +903,7 @@ getting_started_add_documents_md: |-
903903
use futures::executor::block_on;
904904
905905
fn main() { block_on(async move {
906-
let client = Client::new("http://localhost:7700", "masterKey");
906+
let client = Client::new("http://localhost:7700", Some("masterKey"));
907907
908908
// reading and parsing the file
909909
let mut file = File::open("movies.json")
@@ -1022,7 +1022,7 @@ getting_started_update_displayed_attributes: |-
10221022
.await
10231023
.unwrap();
10241024
getting_started_communicating_with_a_protected_instance: |-
1025-
let client = Client::new("http://localhost:7700", "apiKey");
1025+
let client = Client::new("http://localhost:7700", Some("apiKey"));
10261026
client
10271027
.index("movies")
10281028
.search()
@@ -1385,20 +1385,20 @@ delete_a_key_1: |-
13851385
.delete_key(&key)
13861386
.await?;
13871387
authorization_header_1:
1388-
let client = Client::new("http://localhost:7700", "masterKey");
1388+
let client = Client::new("http://localhost:7700", Some("masterKey"));
13891389
let keys = client
13901390
.get_keys()
13911391
.await
13921392
.unwrap();
13931393
security_guide_search_key_1: |-
1394-
let client = Client::new("http://localhost:7700", "apiKey");
1394+
let client = Client::new("http://localhost:7700", Some("apiKey"));
13951395
let result = client.index("patient_medical_records")
13961396
.search()
13971397
.execute()
13981398
.await
13991399
.unwrap();
14001400
security_guide_update_key_1: |-
1401-
let client = Client::new("http://localhost:7700", "masterKey");
1401+
let client = Client::new("http://localhost:7700", Some("masterKey"));
14021402
let mut key = client
14031403
.get_key("74c9c733-3368-4738-bbe5-1d18a5fecb37")
14041404
.await
@@ -1407,7 +1407,7 @@ security_guide_update_key_1: |-
14071407
.with_description("Default Search API key".to_string())
14081408
.update(&client);
14091409
security_guide_create_key_1: |-
1410-
let client = Client::new("http://localhost:7700", "masterKey");
1410+
let client = Client::new("http://localhost:7700", Some("masterKey"));
14111411
let mut key_options = KeyBuilder::new("Search patient records key");
14121412
key_options
14131413
.with_action(Action::Search)
@@ -1418,13 +1418,13 @@ security_guide_create_key_1: |-
14181418
.await
14191419
.unwrap();
14201420
security_guide_list_keys_1: |-
1421-
let client = Client::new("http://localhost:7700", "masterKey");
1421+
let client = Client::new("http://localhost:7700", Some("masterKey"));
14221422
let keys = client
14231423
.get_keys()
14241424
.await
14251425
.unwrap();
14261426
security_guide_delete_key_1: |-
1427-
let client = Client::new("http://localhost:7700", "masterKey");
1427+
let client = Client::new("http://localhost:7700", Some("masterKey"));
14281428
let key = client
14291429
.get_key("ac5cd97d-5a4b-4226-a868-2d0eb6d197ab")
14301430
.await
@@ -1433,7 +1433,7 @@ security_guide_delete_key_1: |-
14331433
.delete_key(&key)
14341434
.await?;
14351435
landing_getting_started_1: |-
1436-
let client = Client::new("http://localhost:7700", "masterKey");
1436+
let client = Client::new("http://localhost:7700", Some("masterKey"));
14371437
14381438
#[derive(Serialize, Deserialize)]
14391439
struct Movie {
@@ -1462,7 +1462,7 @@ tenant_token_guide_generate_sdk_1: |-
14621462
.generate_tenant_token(api_key_uid, search_rules, api_key, expires_at)
14631463
.unwrap();
14641464
tenant_token_guide_search_sdk_1: |-
1465-
let front_end_client = Client::new("http://localhost:7700", token);
1465+
let front_end_client = Client::new("http://localhost:7700", Some(token));
14661466
let results: SearchResults<Patient> = front_end_client
14671467
.index("patient_medical_records")
14681468
.search()

0 commit comments

Comments
 (0)