Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ add_movies_json_1: |-
use futures::executor::block_on;

fn main() { block_on(async move {
let client = Client::new("http://localhost:7700", "masterKey");
let client = Client::new("http://localhost:7700", Some("masterKey"));

// reading and parsing the file
let mut file = File::open("movies.json")
Expand Down Expand Up @@ -903,7 +903,7 @@ getting_started_add_documents_md: |-
use futures::executor::block_on;

fn main() { block_on(async move {
let client = Client::new("http://localhost:7700", "masterKey");
let client = Client::new("http://localhost:7700", Some("masterKey"));

// reading and parsing the file
let mut file = File::open("movies.json")
Expand Down Expand Up @@ -1022,7 +1022,7 @@ getting_started_update_displayed_attributes: |-
.await
.unwrap();
getting_started_communicating_with_a_protected_instance: |-
let client = Client::new("http://localhost:7700", "apiKey");
let client = Client::new("http://localhost:7700", Some("apiKey"));
client
.index("movies")
.search()
Expand Down Expand Up @@ -1385,20 +1385,20 @@ delete_a_key_1: |-
.delete_key(&key)
.await?;
authorization_header_1:
let client = Client::new("http://localhost:7700", "masterKey");
let client = Client::new("http://localhost:7700", Some("masterKey"));
let keys = client
.get_keys()
.await
.unwrap();
security_guide_search_key_1: |-
let client = Client::new("http://localhost:7700", "apiKey");
let client = Client::new("http://localhost:7700", Some("apiKey"));
let result = client.index("patient_medical_records")
.search()
.execute()
.await
.unwrap();
security_guide_update_key_1: |-
let client = Client::new("http://localhost:7700", "masterKey");
let client = Client::new("http://localhost:7700", Some("masterKey"));
let mut key = client
.get_key("74c9c733-3368-4738-bbe5-1d18a5fecb37")
.await
Expand All @@ -1407,7 +1407,7 @@ security_guide_update_key_1: |-
.with_description("Default Search API key".to_string())
.update(&client);
security_guide_create_key_1: |-
let client = Client::new("http://localhost:7700", "masterKey");
let client = Client::new("http://localhost:7700", Some("masterKey"));
let mut key_options = KeyBuilder::new("Search patient records key");
key_options
.with_action(Action::Search)
Expand All @@ -1418,13 +1418,13 @@ security_guide_create_key_1: |-
.await
.unwrap();
security_guide_list_keys_1: |-
let client = Client::new("http://localhost:7700", "masterKey");
let client = Client::new("http://localhost:7700", Some("masterKey"));
let keys = client
.get_keys()
.await
.unwrap();
security_guide_delete_key_1: |-
let client = Client::new("http://localhost:7700", "masterKey");
let client = Client::new("http://localhost:7700", Some("masterKey"));
let key = client
.get_key("ac5cd97d-5a4b-4226-a868-2d0eb6d197ab")
.await
Expand All @@ -1433,7 +1433,7 @@ security_guide_delete_key_1: |-
.delete_key(&key)
.await?;
landing_getting_started_1: |-
let client = Client::new("http://localhost:7700", "masterKey");
let client = Client::new("http://localhost:7700", Some("masterKey"));

#[derive(Serialize, Deserialize)]
struct Movie {
Expand Down Expand Up @@ -1462,7 +1462,7 @@ tenant_token_guide_generate_sdk_1: |-
.generate_tenant_token(api_key_uid, search_rules, api_key, expires_at)
.unwrap();
tenant_token_guide_search_sdk_1: |-
let front_end_client = Client::new("http://localhost:7700", token);
let front_end_client = Client::new("http://localhost:7700", Some(token));
let results: SearchResults<Patient> = front_end_client
.index("patient_medical_records")
.search()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct Movie {

fn main() { block_on(async move {
// Create a client (without sending any request so that can't fail)
let client = Client::new(MEILISEARCH_URL, MEILISEARCH_API_KEY);
let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));

// An index is where the documents are stored.
let movies = client.index("movies");
Expand Down
2 changes: 1 addition & 1 deletion examples/cli-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::io::stdin;

// instantiate the client. load it once
lazy_static! {
static ref CLIENT: Client = Client::new("http://localhost:7700", "masterKey");
static ref CLIENT: Client = Client::new("http://localhost:7700", Some("masterKey"));
}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use meilisearch_sdk::settings::Settings;
// we need an async runtime
#[tokio::main(flavor = "current_thread")]
async fn main() {
let client: Client = Client::new("http://localhost:7700", "masterKey");
let client: Client = Client::new("http://localhost:7700", Some("masterKey"));

// We try to create an index called `movies` with a primary_key of `movie_id`.
let my_index: Index = client
Expand Down
2 changes: 1 addition & 1 deletion examples/web_app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod document;
use crate::document::{display, Crate};

lazy_static! {
static ref CLIENT: Client = Client::new("http://localhost:7700", "masterKey",);
static ref CLIENT: Client = Client::new("http://localhost:7700", Some("masterKey"));
}

struct Model {
Expand Down
2 changes: 1 addition & 1 deletion meilisearch-test-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn meilisearch_test(params: TokenStream, input: TokenStream) -> TokenStream
let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
));
outer_block.push(parse_quote!(
let client = Client::new(MEILISEARCH_URL, MEILISEARCH_API_KEY);
let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));
));
}

Expand Down
Loading