diff --git a/Cargo.lock b/Cargo.lock index 94097618e..671d39894 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -942,7 +942,7 @@ dependencies = [ [[package]] name = "filter-parser" version = "0.1.0" -source = "git+https://github.com/meilisearch/milli.git?tag=v0.21.0#c83b77304a3062bdbb5b2a3503a710711caebdea" +source = "git+https://github.com/meilisearch/milli.git?tag=v0.21.1#7f50ca9a20090fc4fe2abae0394c1e6fdd351ebd" dependencies = [ "nom", "nom_locate", @@ -1639,7 +1639,7 @@ dependencies = [ [[package]] name = "meilisearch-error" -version = "0.25.0" +version = "0.25.2" dependencies = [ "actix-http", "actix-web", @@ -1651,7 +1651,7 @@ dependencies = [ [[package]] name = "meilisearch-http" -version = "0.25.0" +version = "0.25.2" dependencies = [ "actix-cors", "actix-rt", @@ -1723,7 +1723,7 @@ dependencies = [ [[package]] name = "meilisearch-lib" -version = "0.25.0" +version = "0.25.2" dependencies = [ "actix-rt", "actix-web", @@ -1825,8 +1825,8 @@ dependencies = [ [[package]] name = "milli" -version = "0.21.0" -source = "git+https://github.com/meilisearch/milli.git?tag=v0.21.0#c83b77304a3062bdbb5b2a3503a710711caebdea" +version = "0.21.1" +source = "git+https://github.com/meilisearch/milli.git?tag=v0.21.1#7f50ca9a20090fc4fe2abae0394c1e6fdd351ebd" dependencies = [ "bimap", "bincode", diff --git a/meilisearch-error/Cargo.toml b/meilisearch-error/Cargo.toml index 0be85b557..981aab747 100644 --- a/meilisearch-error/Cargo.toml +++ b/meilisearch-error/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meilisearch-error" -version = "0.25.0" +version = "0.25.2" authors = ["marin "] edition = "2018" diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index 0f4e8fa54..64766bcc5 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -4,7 +4,7 @@ description = "MeiliSearch HTTP server" edition = "2018" license = "MIT" name = "meilisearch-http" -version = "0.25.0" +version = "0.25.2" [[bin]] name = "meilisearch" diff --git a/meilisearch-http/tests/common/index.rs b/meilisearch-http/tests/common/index.rs index 81bdd2f9d..6c44ea369 100644 --- a/meilisearch-http/tests/common/index.rs +++ b/meilisearch-http/tests/common/index.rs @@ -35,15 +35,12 @@ pub struct Index<'a> { #[allow(dead_code)] impl Index<'_> { pub async fn get(&self) -> (Value, StatusCode) { - let url = format!("/indexes/{}", encode(self.uid.as_ref()).to_string()); + let url = format!("/indexes/{}", encode(self.uid.as_ref())); self.service.get(url).await } pub async fn load_test_set(&self) -> u64 { - let url = format!( - "/indexes/{}/documents", - encode(self.uid.as_ref()).to_string() - ); + let url = format!("/indexes/{}/documents", encode(self.uid.as_ref())); let (response, code) = self .service .post_str(url, include_str!("../assets/test_set.json")) @@ -66,13 +63,13 @@ impl Index<'_> { let body = json!({ "primaryKey": primary_key, }); - let url = format!("/indexes/{}", encode(self.uid.as_ref()).to_string()); + let url = format!("/indexes/{}", encode(self.uid.as_ref())); self.service.put(url, body).await } pub async fn delete(&self) -> (Value, StatusCode) { - let url = format!("/indexes/{}", encode(self.uid.as_ref()).to_string()); + let url = format!("/indexes/{}", encode(self.uid.as_ref())); self.service.delete(url).await } @@ -84,13 +81,10 @@ impl Index<'_> { let url = match primary_key { Some(key) => format!( "/indexes/{}/documents?primaryKey={}", - encode(self.uid.as_ref()).to_string(), + encode(self.uid.as_ref()), key ), - None => format!( - "/indexes/{}/documents", - encode(self.uid.as_ref()).to_string() - ), + None => format!("/indexes/{}/documents", encode(self.uid.as_ref())), }; self.service.post(url, documents).await } @@ -103,13 +97,10 @@ impl Index<'_> { let url = match primary_key { Some(key) => format!( "/indexes/{}/documents?primaryKey={}", - encode(self.uid.as_ref()).to_string(), + encode(self.uid.as_ref()), key ), - None => format!( - "/indexes/{}/documents", - encode(self.uid.as_ref()).to_string() - ), + None => format!("/indexes/{}/documents", encode(self.uid.as_ref())), }; self.service.put(url, documents).await } @@ -145,19 +136,12 @@ impl Index<'_> { id: u64, _options: Option, ) -> (Value, StatusCode) { - let url = format!( - "/indexes/{}/documents/{}", - encode(self.uid.as_ref()).to_string(), - id - ); + let url = format!("/indexes/{}/documents/{}", encode(self.uid.as_ref()), id); self.service.get(url).await } pub async fn get_all_documents(&self, options: GetAllDocumentsOptions) -> (Value, StatusCode) { - let mut url = format!( - "/indexes/{}/documents?", - encode(self.uid.as_ref()).to_string() - ); + let mut url = format!("/indexes/{}/documents?", encode(self.uid.as_ref())); if let Some(limit) = options.limit { url.push_str(&format!("limit={}&", limit)); } @@ -177,26 +161,19 @@ impl Index<'_> { } pub async fn delete_document(&self, id: u64) -> (Value, StatusCode) { - let url = format!( - "/indexes/{}/documents/{}", - encode(self.uid.as_ref()).to_string(), - id - ); + let url = format!("/indexes/{}/documents/{}", encode(self.uid.as_ref()), id); self.service.delete(url).await } pub async fn clear_all_documents(&self) -> (Value, StatusCode) { - let url = format!( - "/indexes/{}/documents", - encode(self.uid.as_ref()).to_string() - ); + let url = format!("/indexes/{}/documents", encode(self.uid.as_ref())); self.service.delete(url).await } pub async fn delete_batch(&self, ids: Vec) -> (Value, StatusCode) { let url = format!( "/indexes/{}/documents/delete-batch", - encode(self.uid.as_ref()).to_string() + encode(self.uid.as_ref()) ); self.service .post(url, serde_json::to_value(&ids).unwrap()) @@ -204,31 +181,22 @@ impl Index<'_> { } pub async fn settings(&self) -> (Value, StatusCode) { - let url = format!( - "/indexes/{}/settings", - encode(self.uid.as_ref()).to_string() - ); + let url = format!("/indexes/{}/settings", encode(self.uid.as_ref())); self.service.get(url).await } pub async fn update_settings(&self, settings: Value) -> (Value, StatusCode) { - let url = format!( - "/indexes/{}/settings", - encode(self.uid.as_ref()).to_string() - ); + let url = format!("/indexes/{}/settings", encode(self.uid.as_ref())); self.service.post(url, settings).await } pub async fn delete_settings(&self) -> (Value, StatusCode) { - let url = format!( - "/indexes/{}/settings", - encode(self.uid.as_ref()).to_string() - ); + let url = format!("/indexes/{}/settings", encode(self.uid.as_ref())); self.service.delete(url).await } pub async fn stats(&self) -> (Value, StatusCode) { - let url = format!("/indexes/{}/stats", encode(self.uid.as_ref()).to_string()); + let url = format!("/indexes/{}/stats", encode(self.uid.as_ref())); self.service.get(url).await } @@ -253,17 +221,13 @@ impl Index<'_> { } pub async fn search_post(&self, query: Value) -> (Value, StatusCode) { - let url = format!("/indexes/{}/search", encode(self.uid.as_ref()).to_string()); + let url = format!("/indexes/{}/search", encode(self.uid.as_ref())); self.service.post(url, query).await } pub async fn search_get(&self, query: Value) -> (Value, StatusCode) { let params = serde_url_params::to_string(&query).unwrap(); - let url = format!( - "/indexes/{}/search?{}", - encode(self.uid.as_ref()).to_string(), - params - ); + let url = format!("/indexes/{}/search?{}", encode(self.uid.as_ref()), params); self.service.get(url).await } diff --git a/meilisearch-lib/Cargo.toml b/meilisearch-lib/Cargo.toml index c378d5f3b..d38cfd5df 100644 --- a/meilisearch-lib/Cargo.toml +++ b/meilisearch-lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meilisearch-lib" -version = "0.25.0" +version = "0.25.2" edition = "2018" resolver = "2" @@ -30,7 +30,7 @@ lazy_static = "1.4.0" log = "0.4.14" meilisearch-error = { path = "../meilisearch-error" } meilisearch-auth = { path = "../meilisearch-auth" } -milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.21.0" } +milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.21.1" } mime = "0.3.16" num_cpus = "1.13.0" once_cell = "1.8.0" diff --git a/meilisearch-lib/src/index/dump.rs b/meilisearch-lib/src/index/dump.rs index ace589529..2c20adda2 100644 --- a/meilisearch-lib/src/index/dump.rs +++ b/meilisearch-lib/src/index/dump.rs @@ -28,9 +28,7 @@ impl Index { pub fn dump(&self, path: impl AsRef) -> Result<()> { // acquire write txn make sure any ongoing write is finished before we start. let txn = self.env.write_txn()?; - let path = path - .as_ref() - .join(format!("indexes/{}", self.uuid.to_string())); + let path = path.as_ref().join(format!("indexes/{}", self.uuid)); create_dir_all(&path)?;