From ee6be4f6b96fd0ec42f3248c511eabdc70e81c5b Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 24 Mar 2022 14:44:52 +0100 Subject: [PATCH 1/3] Import milli from meilisearch-lib in meilisearch-http --- Cargo.lock | 1 - meilisearch-http/Cargo.toml | 1 - meilisearch-http/src/helpers/env.rs | 3 ++- meilisearch-lib/src/lib.rs | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11becd56e..178cf7769 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1909,7 +1909,6 @@ dependencies = [ "meilisearch-auth", "meilisearch-error", "meilisearch-lib", - "milli", "mime", "num_cpus", "obkv", diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index 4a3b74b1f..546e414ce 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -47,7 +47,6 @@ log = "0.4.14" meilisearch-auth = { path = "../meilisearch-auth" } meilisearch-error = { path = "../meilisearch-error" } meilisearch-lib = { path = "../meilisearch-lib" } -milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.24.0" } mime = "0.3.16" num_cpus = "1.13.1" obkv = "0.2.0" diff --git a/meilisearch-http/src/helpers/env.rs b/meilisearch-http/src/helpers/env.rs index b36bdce0d..7c8237dad 100644 --- a/meilisearch-http/src/helpers/env.rs +++ b/meilisearch-http/src/helpers/env.rs @@ -1,10 +1,11 @@ +use meilisearch_lib::milli::heed::Env; use walkdir::WalkDir; pub trait EnvSizer { fn size(&self) -> u64; } -impl EnvSizer for milli::heed::Env { +impl EnvSizer for Env { fn size(&self) -> u64 { WalkDir::new(self.path()) .into_iter() diff --git a/meilisearch-lib/src/lib.rs b/meilisearch-lib/src/lib.rs index c49acfeee..b5bdd36c6 100644 --- a/meilisearch-lib/src/lib.rs +++ b/meilisearch-lib/src/lib.rs @@ -13,7 +13,6 @@ mod update_file_store; use std::path::Path; pub use index_controller::MeiliSearch; - pub use milli; mod compression; From 09212abdf7b9901bb952090b5ecdeaeeb0dcc8e9 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 24 Mar 2022 14:53:08 +0100 Subject: [PATCH 2/3] Update the cargo lock --- Cargo.lock | 171 +++++++++++++++++++++++++++-------------------------- 1 file changed, 86 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 178cf7769..250cb37f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,8 +77,8 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" dependencies = [ - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -200,7 +200,7 @@ dependencies = [ "serde_urlencoded", "smallvec", "socket2", - "time 0.3.7", + "time 0.3.9", "url", ] @@ -212,8 +212,8 @@ checksum = "7525bedf54704abb1d469e88d7e7e9226df73778798a69cea5022d53b2ae91bc" dependencies = [ "actix-router", "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -331,8 +331,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -342,8 +342,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -515,8 +515,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -563,9 +563,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e270ef0cd868745878982f7ce470aa898d0d4bb248af67f0cf66f54617913ef" +checksum = "5809dd3e6444651fd1cdd3dbec71eca438c439a0fcc8081674a14da0afe50185" dependencies = [ "serde", "serde_derive", @@ -647,8 +647,8 @@ dependencies = [ "heck", "proc-macro-error", "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -658,8 +658,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df715824eb382e34b7afb7463b0247bf41538aeba731fba05241ecdb5dc3747" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -675,7 +675,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94d4706de1b0fa5b132270cddffa8585166037822e260a944fe161acd137ca05" dependencies = [ "percent-encoding", - "time 0.3.7", + "time 0.3.9", "version_check", ] @@ -703,9 +703,9 @@ checksum = "79bb3adfaf5f75d24b01aee375f7555907840fa2800e5ec8fa3b9e2031830173" [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" dependencies = [ "libc", ] @@ -730,9 +730,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbfe11fe19ff083c48923cf179540e8cd0535903dc35e178a1fdeeb59aef51f" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils 0.8.8", @@ -831,8 +831,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -843,9 +843,9 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.16", "rustc_version", - "syn 1.0.88", + "syn 1.0.89", ] [[package]] @@ -992,8 +992,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -1170,8 +1170,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -1266,8 +1266,8 @@ checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" dependencies = [ "proc-macro-error", "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -1459,9 +1459,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.17" +version = "0.14.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043f0e083e9901b6cc658a77d1eb86f4fc650bbb977a4337dd63192826aa85dd" +checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" dependencies = [ "bytes", "futures-channel", @@ -1635,9 +1635,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.120" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad5c14e80759d0939d013e6ca49930e59fc53dd8e5009132f76240c179380c09" +checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f" [[package]] name = "libgit2-sys" @@ -1798,9 +1798,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if 1.0.0", ] @@ -1823,8 +1823,8 @@ checksum = "10a9062912d7952c5588cc474795e0b9ee008e7e6781127945b85413d4b99d81" dependencies = [ "log", "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -1861,7 +1861,7 @@ dependencies = [ "serde_json", "sha2", "thiserror", - "time 0.3.7", + "time 0.3.9", ] [[package]] @@ -1937,7 +1937,7 @@ dependencies = [ "tempfile", "thiserror", "tikv-jemallocator", - "time 0.3.7", + "time 0.3.9", "tokio", "tokio-stream", "urlencoding", @@ -2000,7 +2000,7 @@ dependencies = [ "tar", "tempfile", "thiserror", - "time 0.3.7", + "time 0.3.9", "tokio", "uuid", "walkdir", @@ -2086,7 +2086,7 @@ dependencies = [ "smallstr", "smallvec", "tempfile", - "time 0.3.7", + "time 0.3.9", "uuid", ] @@ -2124,9 +2124,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba42135c6a5917b9db9cd7b293e5409e1c6b041e6f9825e92e55a894c63b6f8" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ "libc", "log", @@ -2168,8 +2168,8 @@ checksum = "79ef208208a0dea3f72221e26e904cdc6db2e481d9ade89081ddd494f1dbaa6b" dependencies = [ "cfg-if 1.0.0", "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -2273,9 +2273,9 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c539a50b93a303167eded6e8dff5220cd39447409fb659f4cd24b1f72fe4f133" +checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" dependencies = [ "libc", ] @@ -2536,8 +2536,8 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", "version_check", ] @@ -2548,7 +2548,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.16", "version_check", ] @@ -2633,9 +2633,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "b4af2ec4714533fcdf07e886f17025ace8b997b9ce51204ee69b6da831c3da57" dependencies = [ "proc-macro2 1.0.36", ] @@ -2715,12 +2715,13 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "7776223e2696f1aa4c6b0170e83212f47296a00424305117d013dfe86fb0fe55" dependencies = [ "getrandom", "redox_syscall", + "thiserror", ] [[package]] @@ -2970,7 +2971,7 @@ dependencies = [ "serde", "serde_json", "thiserror", - "time 0.3.7", + "time 0.3.9", ] [[package]] @@ -2995,8 +2996,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -3073,7 +3074,7 @@ dependencies = [ "num-bigint", "num-traits", "thiserror", - "time 0.3.7", + "time 0.3.9", ] [[package]] @@ -3162,12 +3163,12 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd69e719f31e88618baa1eaa6ee2de5c9a1c004f1e9ecdb58e8352a13f20a01" +checksum = "ea297be220d52398dcc07ce15a209fce436d361735ac1db700cab3b6cdfb9f54" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", + "quote 1.0.16", "unicode-xid 0.2.2", ] @@ -3187,8 +3188,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", "unicode-xid 0.2.2", ] @@ -3269,8 +3270,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -3306,9 +3307,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004cbc98f30fa233c61a38bc77e96a9106e65c88f2d3bef182ae952027e5753d" +checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" dependencies = [ "itoa 1.0.1", "libc", @@ -3320,9 +3321,9 @@ dependencies = [ [[package]] name = "time-macros" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25eb0ca3468fc0acc11828786797f6ef9aa1555e4a211a60d64cc8e4d1be47d6" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" [[package]] name = "tinyvec" @@ -3366,8 +3367,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", ] [[package]] @@ -3382,9 +3383,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.2" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b" +checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" dependencies = [ "rustls", "tokio", @@ -3546,9 +3547,9 @@ checksum = "68b90931029ab9b034b300b797048cf23723400aa757e8a2bfb9d748102f9821" [[package]] name = "utf8-width" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cf7d77f457ef8dfa11e4cd5933c5ddb5dc52a94664071951219a97710f0a32b" +checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" [[package]] name = "uuid" @@ -3579,7 +3580,7 @@ dependencies = [ "git2", "rustversion", "thiserror", - "time 0.3.7", + "time 0.3.9", ] [[package]] @@ -3650,8 +3651,8 @@ dependencies = [ "lazy_static", "log", "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", "wasm-bindgen-shared", ] @@ -3673,7 +3674,7 @@ version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" dependencies = [ - "quote 1.0.15", + "quote 1.0.16", "wasm-bindgen-macro-support", ] @@ -3684,8 +3685,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2 1.0.36", - "quote 1.0.15", - "syn 1.0.88", + "quote 1.0.16", + "syn 1.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3859,7 +3860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d498dbd1fd7beb83c86709ae1c33ca50942889473473d287d56ce4770a18edfb" dependencies = [ "proc-macro2 1.0.36", - "syn 1.0.88", + "syn 1.0.89", "synstructure", ] From 3df542f07245cd90f7051a31dce36d42bfe561b2 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 24 Mar 2022 15:30:10 +0100 Subject: [PATCH 3/3] Export milli's heed from meilisearch-lib --- meilisearch-http/src/helpers/env.rs | 2 +- meilisearch-lib/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meilisearch-http/src/helpers/env.rs b/meilisearch-http/src/helpers/env.rs index 7c8237dad..b76c9c8a7 100644 --- a/meilisearch-http/src/helpers/env.rs +++ b/meilisearch-http/src/helpers/env.rs @@ -1,4 +1,4 @@ -use meilisearch_lib::milli::heed::Env; +use meilisearch_lib::heed::Env; use walkdir::WalkDir; pub trait EnvSizer { diff --git a/meilisearch-lib/src/lib.rs b/meilisearch-lib/src/lib.rs index b5bdd36c6..1161340ba 100644 --- a/meilisearch-lib/src/lib.rs +++ b/meilisearch-lib/src/lib.rs @@ -14,6 +14,7 @@ use std::path::Path; pub use index_controller::MeiliSearch; pub use milli; +pub use milli::heed; mod compression; pub mod document_formats;