diff --git a/src/client.rs b/src/client.rs index 15a605e4..348b2217 100644 --- a/src/client.rs +++ b/src/client.rs @@ -481,9 +481,10 @@ impl Client { /// # futures::executor::block_on(async move { /// let client = Client::new(MEILISEARCH_HOST, MEILISEARCH_API_KEY); /// # let key = client.get_keys().await.unwrap().results.into_iter() - /// .find(|k| k.name.as_ref().map_or(false, |name| name.starts_with("Default Search API Key"))); - /// let key_id = key.unwrap().key; // enter your API key here, for the example we use the search API key. - /// let key = client.get_key(key_id).await.unwrap(); + /// .find(|k| k.name.as_ref().map_or(false, |name| name.starts_with("Default Search API Key"))) + /// .unwrap(); + /// + /// let key = client.get_key(key).await.unwrap(); /// /// assert_eq!(key.name, Some("Default Search API Key".to_string())); /// # }); @@ -741,12 +742,10 @@ impl Client { /// # /// # futures::executor::block_on(async move { /// # let client = client::Client::new(MEILISEARCH_HOST, MEILISEARCH_API_KEY); + /// /// let mut query = tasks::TasksQuery::new(&client); /// query.with_index_uid(["get_tasks_with"]); /// let tasks = client.get_tasks_with(&query).await.unwrap(); - /// - /// # assert!(tasks.results.len() > 0); - /// # client.index("get_tasks_with").delete().await.unwrap().wait_for_completion(&client, None, None).await.unwrap(); /// # }); /// ``` pub async fn get_tasks_with( diff --git a/src/indexes.rs b/src/indexes.rs index 1309e8dd..8570e3e0 100644 --- a/src/indexes.rs +++ b/src/indexes.rs @@ -407,6 +407,7 @@ impl Index { pub async fn get_documents_with( &self, documents_query: &DocumentsQuery<'_>, + ) -> Result, Error> { let url = format!("{}/indexes/{}/documents", self.client.host, self.uid); request::<&DocumentsQuery, DocumentsResults>( &url, @@ -467,7 +468,7 @@ impl Index { /// client.wait_for_task(task, None, None).await.unwrap(); /// /// let movies = movie_index.get_documents::().await.unwrap(); - /// assert!(movies.len() >= 3); + /// assert!(movies.results.len() >= 3); /// # movie_index.delete().await.unwrap().wait_for_completion(&client, None, None).await.unwrap(); /// # }); /// ``` @@ -545,7 +546,7 @@ impl Index { /// client.wait_for_task(task, None, None).await.unwrap(); /// /// let movies = movie_index.get_documents::().await.unwrap(); - /// assert!(movies.len() >= 3); + /// assert!(movies.results.len() >= 3); /// # movie_index.delete().await.unwrap().wait_for_completion(&client, None, None).await.unwrap(); /// # }); /// ``` diff --git a/src/tasks.rs b/src/tasks.rs index e62fc60f..45418631 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -279,7 +279,6 @@ impl Task { /// # let task = client.create_index("unwrap_failure", None).await.unwrap(); /// # let index = client.wait_for_task(task, None, None).await.unwrap().try_make_index(&client).unwrap(); /// - /// // TODO: fails until http method are implemented /// let task = index.set_ranking_rules(["wrong_ranking_rule"]) /// .await /// .unwrap()