diff --git a/Cargo.lock b/Cargo.lock index a83cd9369..81110ddeb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,7 +7,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78d1833b3838dbe990df0f1f87baf640cf6146e898166afe401839d1b001e570" dependencies = [ "bitflags", - "bytes", + "bytes 0.5.6", "futures-core", "futures-sink", "log", @@ -40,21 +40,23 @@ dependencies = [ [[package]] name = "actix-cors" -version = "0.4.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e5c769e4d332bfad27f11b8139b5818c4bbddb02c385b8f16344d93ff1a8eb" +checksum = "3f3a3d5493dbc9b8769fe88c030d057ef8d2edc5728e5e26267780e8fc5db0be" dependencies = [ - "actix-service", "actix-web", "derive_more", "futures-util", + "log", + "once_cell", + "tinyvec 1.0.1", ] [[package]] name = "actix-http" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404df68c297f73b8d36c9c9056404913d25905a8f80127b0e5fe147c9c4b9f02" +checksum = "452299e87817ae5673910e53c243484ca38be3828db819b6011736fc6982e874" dependencies = [ "actix-codec", "actix-connect", @@ -66,7 +68,7 @@ dependencies = [ "base64 0.13.0", "bitflags", "brotli2", - "bytes", + "bytes 0.5.6", "cookie", "copyless", "derive_more", @@ -92,7 +94,7 @@ dependencies = [ "regex", "serde", "serde_json", - "serde_urlencoded", + "serde_urlencoded 0.7.0", "sha-1 0.9.1", "slab", "time 0.2.22", @@ -221,7 +223,7 @@ dependencies = [ "actix-rt", "actix-service", "bitflags", - "bytes", + "bytes 0.5.6", "either", "futures-channel", "futures-sink", @@ -233,9 +235,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "3.1.0" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b12fe25e11cd9ed2ef2e428427eb6178a1b363f3f7f0dab8278572f11b2da1" +checksum = "e641d4a172e7faa0862241a20ff4f1f5ab0ab7c279f00c2d4587b77483477b86" dependencies = [ "actix-codec", "actix-http", @@ -250,7 +252,7 @@ dependencies = [ "actix-utils", "actix-web-codegen", "awc", - "bytes", + "bytes 0.5.6", "derive_more", "encoding_rs", "futures-channel", @@ -259,12 +261,12 @@ dependencies = [ "fxhash", "log", "mime", - "pin-project 0.4.27", + "pin-project 1.0.1", "regex", "rustls", "serde", "serde_json", - "serde_urlencoded", + "serde_urlencoded 0.7.0", "socket2", "time 0.2.22", "tinyvec 1.0.1", @@ -273,9 +275,9 @@ dependencies = [ [[package]] name = "actix-web-codegen" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "750ca8fb60bbdc79491991650ba5d2ae7cd75f3fc00ead51390cfe9efda0d4d8" +checksum = "ad26f77093333e0e7c6ffe54ebe3582d908a104e448723eec6d43d08b07143fb" dependencies = [ "proc-macro2", "quote", @@ -372,16 +374,17 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "awc" -version = "2.0.0" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "150e00c06683ab44c5f97d033950e5d87a7a042d06d77f5eecb443cbd23d0575" +checksum = "b381e490e7b0cfc37ebc54079b0413d8093ef43d14a4e4747083f7fa47a9e691" dependencies = [ "actix-codec", "actix-http", "actix-rt", "actix-service", - "base64 0.12.3", - "bytes", + "base64 0.13.0", + "bytes 0.5.6", + "cfg-if 1.0.0", "derive_more", "futures-core", "log", @@ -391,7 +394,7 @@ dependencies = [ "rustls", "serde", "serde_json", - "serde_urlencoded", + "serde_urlencoded 0.7.0", ] [[package]] @@ -537,13 +540,19 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +[[package]] +name = "bytes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0dcbc35f504eb6fc275a6d20e4ebcda18cf50d40ba6fabff8c711fa16cb3b16" + [[package]] name = "bytestring" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7c05fa5172da78a62d9949d662d2ac89d4cc7355d7b49adee5163f1fb3f363" dependencies = [ - "bytes", + "bytes 0.5.6", ] [[package]] @@ -749,6 +758,25 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" +dependencies = [ + "crossbeam-utils 0.6.6", +] + +[[package]] +name = "crossbeam-utils" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" +dependencies = [ + "cfg-if 0.1.10", + "lazy_static", +] + [[package]] name = "crossbeam-utils" version = "0.7.2" @@ -794,12 +822,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "data-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" - [[package]] name = "debugid" version = "0.7.2" @@ -891,7 +913,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" dependencies = [ "atty", - "humantime", + "humantime 1.3.0", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" +dependencies = [ + "atty", + "humantime 2.0.1", "log", "regex", "termcolor", @@ -955,6 +990,26 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "fs_extra" version = "1.2.0" @@ -1135,7 +1190,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" dependencies = [ - "bytes", + "bytes 0.5.6", "fnv", "futures-core", "futures-sink", @@ -1175,9 +1230,9 @@ dependencies = [ [[package]] name = "heed" -version = "0.8.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c9d6f92f402a1452d658038a279d882c77fc5c1f50f29eb491b5fac537f479" +checksum = "2eaba3b0edee6a9cd551f24caca2027922b03259f7203a15f0b86af4c1348fcc" dependencies = [ "byteorder", "heed-traits", @@ -1186,6 +1241,7 @@ dependencies = [ "lmdb-rkv-sys", "once_cell", "page_size", + "synchronoise", "url", "zerocopy", ] @@ -1198,9 +1254,9 @@ checksum = "b328f6260a7e51bdb0ca6b68e6ea27ee3d11fba5dee930896ee7ff6ad5fc072c" [[package]] name = "heed-types" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e100387815256b00dbb4f48db990f7fa03e9b88b4a89c2a1661b7d9d77b77c46" +checksum = "e628efb08beaee58355f80dc4adba79d644940ea9eef60175ea17dc218aab405" dependencies = [ "bincode", "heed-traits", @@ -1235,7 +1291,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" dependencies = [ - "bytes", + "bytes 0.5.6", "fnv", "itoa", ] @@ -1246,7 +1302,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ - "bytes", + "bytes 0.5.6", "http", ] @@ -1271,13 +1327,19 @@ dependencies = [ "quick-error", ] +[[package]] +name = "humantime" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" + [[package]] name = "hyper" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f3afcfae8af5ad0576a31e768415edb627824129e8e5a29b8bfccb2f234e835" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-channel", "futures-core", "futures-util", @@ -1301,7 +1363,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-util", "hyper", "log", @@ -1470,9 +1532,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.79" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743" +checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" [[package]] name = "linked-hash-map" @@ -1564,7 +1626,7 @@ dependencies = [ "csv", "deunicode", "either", - "env_logger", + "env_logger 0.8.2", "fst", "hashbrown", "heed", @@ -1612,10 +1674,10 @@ dependencies = [ "actix-service", "actix-web", "assert-json-diff", - "bytes", + "bytes 0.6.0", "chrono", "crossbeam-channel 0.5.0", - "env_logger", + "env_logger 0.8.2", "flate2", "futures", "http", @@ -1774,13 +1836,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.18.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" +checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" dependencies = [ "bitflags", "cc", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", ] @@ -1821,9 +1883,9 @@ checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693" [[package]] name = "once_cell" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" [[package]] name = "oorandom" @@ -1845,9 +1907,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "ordered-float" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fe9037165d7023b1228bc4ae9a2fa1a2b0095eca6c2998c624723dfd01314a5" +checksum = "dacdec97876ef3ede8c50efc429220641a0b11ba0048b4b0c357bccbc47c5204" dependencies = [ "num-traits", "serde", @@ -2211,9 +2273,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "regex" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b" +checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" dependencies = [ "aho-corasick", "memchr", @@ -2232,9 +2294,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.20" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c" +checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" [[package]] name = "remove_dir_all" @@ -2252,7 +2314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e" dependencies = [ "base64 0.12.3", - "bytes", + "bytes 0.5.6", "encoding_rs", "futures-core", "futures-util", @@ -2271,7 +2333,7 @@ dependencies = [ "rustls", "serde", "serde_json", - "serde_urlencoded", + "serde_urlencoded 0.6.1", "tokio", "tokio-rustls", "url", @@ -2337,11 +2399,13 @@ dependencies = [ [[package]] name = "rustyline" -version = "6.3.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0d5e7b0219a3eadd5439498525d4765c59b7c993ef0c12244865cd2d988413" +checksum = "1a5f54deba50e65ee4cf786dbc37e8b3c63bdccccbcf9d3a8a9fd0c1bb7e1984" dependencies = [ - "cfg-if 0.1.10", + "bitflags", + "cfg-if 1.0.0", + "fs2", "libc", "log", "memchr", @@ -2412,7 +2476,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b01b723fc1b0a0f9394ca1a8451daec6e20206d47f96c3dceea7fd11ec9eec0" dependencies = [ "backtrace", - "env_logger", + "env_logger 0.7.1", "failure", "hostname", "httpdate", @@ -2446,9 +2510,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" dependencies = [ "serde_derive", ] @@ -2465,9 +2529,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" dependencies = [ "proc-macro2", "quote", @@ -2488,11 +2552,10 @@ dependencies = [ [[package]] name = "serde_qs" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9408a61dabe404c76cec504ec510f7d92f41dc0a9362a0db8ab73d141cfbf93f" +checksum = "0010b5c91a2b37b51b91dc29a20553b6384fef574bb4cf3c0fc5a04c3bab7e47" dependencies = [ - "data-encoding", "percent-encoding", "serde", "thiserror", @@ -2520,6 +2583,18 @@ dependencies = [ "url", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "sha-1" version = "0.8.2" @@ -2610,11 +2685,11 @@ checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" [[package]] name = "socket2" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" +checksum = "2c29947abdee2a218277abeca306f25789c938e500ea5a9d4b12a5a504466902" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "redox_syscall", "winapi 0.3.9", @@ -2716,15 +2791,24 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.44" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03e57e4fcbfe7749842d53e24ccb9aa12b7252dbe5e91d2acad31834c8b8fdd" +checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] +[[package]] +name = "synchronoise" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d717ed0efc9d39ab3b642a096bc369a3e02a38a51c41845d7fe31bdad1d6eaeb" +dependencies = [ + "crossbeam-queue", +] + [[package]] name = "synstructure" version = "0.12.4" @@ -2793,18 +2877,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" +checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" +checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" dependencies = [ "proc-macro2", "quote", @@ -2915,7 +2999,7 @@ version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" dependencies = [ - "bytes", + "bytes 0.5.6", "fnv", "futures-core", "iovec", @@ -2961,7 +3045,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" dependencies = [ - "bytes", + "bytes 0.5.6", "futures-core", "futures-sink", "log", @@ -3133,10 +3217,11 @@ dependencies = [ [[package]] name = "url" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" dependencies = [ + "form_urlencoded", "idna", "matches", "percent-encoding", @@ -3322,9 +3407,13 @@ dependencies = [ [[package]] name = "whoami" -version = "0.9.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7884773ab69074615cb8f8425d0e53f11710786158704fca70f53e71b0e05504" +checksum = "e0b81b8c1996f45197d8aad89b388f0a419afb4c5c876a23006d2d1435cb82d8" +dependencies = [ + "wasm-bindgen", + "web-sys", +] [[package]] name = "widestring" diff --git a/meilisearch-core/Cargo.toml b/meilisearch-core/Cargo.toml index 78fb2f82d..7be946d1b 100644 --- a/meilisearch-core/Cargo.toml +++ b/meilisearch-core/Cargo.toml @@ -15,10 +15,10 @@ cow-utils = "0.1.2" crossbeam-channel = "0.5.0" deunicode = "1.1.0" either = "1.5.3" -env_logger = "0.7.1" +env_logger = "0.8.2" fst = "0.4.4" hashbrown = { version = "0.9.0", features = ["serde"] } -heed = "0.8.0" +heed = "0.10.5" indexmap = { version = "1.3.2", features = ["serde-1"] } intervaltree = "0.2.5" itertools = "0.9.0" @@ -28,11 +28,11 @@ meilisearch-error = { path = "../meilisearch-error", version = "0.17.0" } meilisearch-schema = { path = "../meilisearch-schema", version = "0.17.0" } meilisearch-tokenizer = { path = "../meilisearch-tokenizer", version = "0.17.0" } meilisearch-types = { path = "../meilisearch-types", version = "0.17.0" } -once_cell = "1.3.1" -ordered-float = { version = "2.0.0", features = ["serde"] } +once_cell = "1.5.2" +ordered-float = { version = "2.0.1", features = ["serde"] } pest = { git = "https://github.com/pest-parser/pest.git", rev = "51fd1d49f1041f7839975664ef71fe15c7dcaf67" } pest_derive = "2.0" -regex = "1.4.1" +regex = "1.4.2" sdset = "0.4.0" serde = { version = "1.0.117", features = ["derive"] } serde_json = { version = "1.0.59", features = ["preserve_order"] } @@ -44,7 +44,7 @@ zerocopy = "0.3.0" assert_matches = "1.4.0" criterion = "0.3.1" csv = "1.1.3" -rustyline = { version = "6.0.0", default-features = false } +rustyline = { version = "7.0.0", default-features = false } structopt = "0.3.20" tempfile = "3.1.0" termcolor = "1.1.0" diff --git a/meilisearch-core/src/criterion/mod.rs b/meilisearch-core/src/criterion/mod.rs index a2f68c28e..3fe77115a 100644 --- a/meilisearch-core/src/criterion/mod.rs +++ b/meilisearch-core/src/criterion/mod.rs @@ -61,7 +61,7 @@ pub trait Criterion { } pub struct ContextMut<'h, 'p, 'tag, 'txn, 'q> { - pub reader: &'h heed::RoTxn, + pub reader: &'h heed::RoTxn<'h, MainT>, pub postings_lists: &'p mut SmallArena<'tag, PostingsListView<'txn>>, pub query_mapping: &'q HashMap>, pub documents_fields_counts_store: store::DocumentsFieldsCounts, diff --git a/meilisearch-core/src/database.rs b/meilisearch-core/src/database.rs index 82f5fa89d..d93c81acb 100644 --- a/meilisearch-core/src/database.rs +++ b/meilisearch-core/src/database.rs @@ -22,11 +22,11 @@ type ArcSwapFn = arc_swap::ArcSwapOption; type SerdeDatetime = SerdeBincode>; -pub type MainWriter<'a> = heed::RwTxn<'a, MainT>; -pub type MainReader = heed::RoTxn; +pub type MainWriter<'a, 'b> = heed::RwTxn<'a, 'b, MainT>; +pub type MainReader<'a, 'b> = heed::RoTxn<'a, MainT>; -pub type UpdateWriter<'a> = heed::RwTxn<'a, UpdateT>; -pub type UpdateReader = heed::RoTxn; +pub type UpdateWriter<'a, 'b> = heed::RwTxn<'a, 'b, UpdateT>; +pub type UpdateReader<'a> = heed::RoTxn<'a, UpdateT>; const LAST_UPDATE_KEY: &str = "last-update"; diff --git a/meilisearch-core/src/serde/deserializer.rs b/meilisearch-core/src/serde/deserializer.rs index e5e02a4d6..0d091951e 100644 --- a/meilisearch-core/src/serde/deserializer.rs +++ b/meilisearch-core/src/serde/deserializer.rs @@ -51,7 +51,7 @@ impl From for DeserializerError { pub struct Deserializer<'a> { pub document_id: DocumentId, - pub reader: &'a heed::RoTxn, + pub reader: &'a heed::RoTxn<'a, MainT>, pub documents_fields: DocumentsFields, pub schema: &'a Schema, pub fields: Option<&'a HashSet>, diff --git a/meilisearch-core/src/store/docs_words.rs b/meilisearch-core/src/store/docs_words.rs index 11e81f673..6b412d584 100644 --- a/meilisearch-core/src/store/docs_words.rs +++ b/meilisearch-core/src/store/docs_words.rs @@ -33,7 +33,7 @@ impl DocsWords { self.docs_words.clear(writer) } - pub fn doc_words(self, reader: &heed::RoTxn, document_id: DocumentId) -> ZResult { + pub fn doc_words<'a>(self, reader: &'a heed::RoTxn<'a, MainT>, document_id: DocumentId) -> ZResult { let document_id = BEU32::new(document_id.0); match self.docs_words.get(reader, &document_id)? { Some(bytes) => Ok(fst::Set::new(bytes).unwrap().map_data(Cow::Borrowed).unwrap()), diff --git a/meilisearch-core/src/store/facets.rs b/meilisearch-core/src/store/facets.rs index 7436f3d65..1a7579099 100644 --- a/meilisearch-core/src/store/facets.rs +++ b/meilisearch-core/src/store/facets.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use std::collections::HashMap; use std::mem; -use heed::{RwTxn, RoTxn, RoRange, types::Str, BytesEncode, BytesDecode}; +use heed::{RwTxn, RoTxn, RoPrefix, types::Str, BytesEncode, BytesDecode}; use sdset::{SetBuf, Set, SetOperation}; use meilisearch_types::DocumentId; @@ -62,7 +62,7 @@ impl Facets { Ok(self.facets.put(writer, &facet_key, &(facet_value, doc_ids))?) } - pub fn field_document_ids<'txn>(&self, reader: &'txn RoTxn, field_id: FieldId) -> MResult> { + pub fn field_document_ids<'txn>(&self, reader: &'txn RoTxn, field_id: FieldId) -> MResult> { Ok(self.facets.prefix_iter(reader, &FacetKey::new(field_id, String::new()))?) } diff --git a/meilisearch-core/src/store/main.rs b/meilisearch-core/src/store/main.rs index 5accdfbc7..2b60a5680 100644 --- a/meilisearch-core/src/store/main.rs +++ b/meilisearch-core/src/store/main.rs @@ -143,7 +143,7 @@ impl Main { self.put_external_docids(writer, &external_docids) } - pub fn external_docids(self, reader: &heed::RoTxn) -> MResult { + pub fn external_docids<'a>(self, reader: &'a heed::RoTxn<'a, MainT>) -> MResult { match self.main.get::<_, Str, ByteSlice>(reader, EXTERNAL_DOCIDS_KEY)? { Some(bytes) => Ok(fst::Map::new(bytes).unwrap().map_data(Cow::Borrowed).unwrap()), None => Ok(fst::Map::default().map_data(Cow::Owned).unwrap()), @@ -155,7 +155,7 @@ impl Main { Ok(external_ids.get(external_docid).map(|id| DocumentId(id as u32))) } - pub fn words_fst(self, reader: &heed::RoTxn) -> MResult { + pub fn words_fst<'a>(self, reader: &'a heed::RoTxn<'a, MainT>) -> MResult { match self.main.get::<_, Str, ByteSlice>(reader, WORDS_KEY)? { Some(bytes) => Ok(fst::Set::new(bytes).unwrap().map_data(Cow::Borrowed).unwrap()), None => Ok(fst::Set::default().map_data(Cow::Owned).unwrap()), @@ -170,7 +170,7 @@ impl Main { Ok(self.main.put::<_, Str, CowSlice>(writer, SORTED_DOCUMENT_IDS_CACHE_KEY, documents_ids)?) } - pub fn sorted_document_ids_cache(self, reader: &heed::RoTxn) -> MResult>> { + pub fn sorted_document_ids_cache<'a>(self, reader: &'a heed::RoTxn<'a, MainT>) -> MResult>> { Ok(self.main.get::<_, Str, CowSlice>(reader, SORTED_DOCUMENT_IDS_CACHE_KEY)?) } @@ -199,7 +199,7 @@ impl Main { Ok(self.main.put::<_, Str, ByteSlice>(writer, SYNONYMS_KEY, bytes)?) } - pub(crate) fn synonyms_fst(self, reader: &heed::RoTxn) -> MResult { + pub(crate) fn synonyms_fst<'a>(self, reader: &'a heed::RoTxn<'a, MainT>) -> MResult { match self.main.get::<_, Str, ByteSlice>(reader, SYNONYMS_KEY)? { Some(bytes) => Ok(fst::Set::new(bytes).unwrap().map_data(Cow::Borrowed).unwrap()), None => Ok(fst::Set::default().map_data(Cow::Owned).unwrap()), @@ -219,7 +219,7 @@ impl Main { Ok(self.main.put::<_, Str, ByteSlice>(writer, STOP_WORDS_KEY, bytes)?) } - pub(crate) fn stop_words_fst(self, reader: &heed::RoTxn) -> MResult { + pub(crate) fn stop_words_fst<'a>(self, reader: &'a heed::RoTxn<'a, MainT>) -> MResult { match self.main.get::<_, Str, ByteSlice>(reader, STOP_WORDS_KEY)? { Some(bytes) => Ok(fst::Set::new(bytes).unwrap().map_data(Cow::Borrowed).unwrap()), None => Ok(fst::Set::default().map_data(Cow::Owned).unwrap()), diff --git a/meilisearch-core/src/update/documents_addition.rs b/meilisearch-core/src/update/documents_addition.rs index 5603966b0..d46aeb7fe 100644 --- a/meilisearch-core/src/update/documents_addition.rs +++ b/meilisearch-core/src/update/documents_addition.rs @@ -146,8 +146,8 @@ where A: AsRef<[u8]>, Ok(()) } -pub fn apply_addition<'a, 'b>( - writer: &'a mut heed::RwTxn<'b, MainT>, +pub fn apply_addition<'a, 'b, 'c>( + writer: &'a mut heed::RwTxn<'b, 'c, MainT>, index: &store::Index, new_documents: Vec>, partial: bool @@ -272,16 +272,16 @@ pub fn apply_addition<'a, 'b>( Ok(()) } -pub fn apply_documents_partial_addition<'a, 'b>( - writer: &'a mut heed::RwTxn<'b, MainT>, +pub fn apply_documents_partial_addition<'a, 'b, 'c>( + writer: &'a mut heed::RwTxn<'b, 'c, MainT>, index: &store::Index, new_documents: Vec>, ) -> MResult<()> { apply_addition(writer, index, new_documents, true) } -pub fn apply_documents_addition<'a, 'b>( - writer: &'a mut heed::RwTxn<'b, MainT>, +pub fn apply_documents_addition<'a, 'b, 'c>( + writer: &'a mut heed::RwTxn<'b, 'c, MainT>, index: &store::Index, new_documents: Vec>, ) -> MResult<()> { diff --git a/meilisearch-core/src/update/mod.rs b/meilisearch-core/src/update/mod.rs index 2f3d7bd8c..d1ea83108 100644 --- a/meilisearch-core/src/update/mod.rs +++ b/meilisearch-core/src/update/mod.rs @@ -212,8 +212,8 @@ pub fn next_update_id( Ok(new_update_id) } -pub fn update_task<'a, 'b>( - writer: &'a mut heed::RwTxn<'b, MainT>, +pub fn update_task<'a, 'b, 'c>( + writer: &'a mut heed::RwTxn<'b, 'c, MainT>, index: &store::Index, update_id: u64, update: Update, diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index 52b3ad4e3..6818443e6 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -17,15 +17,15 @@ path = "src/main.rs" default = ["sentry"] [dependencies] -actix-cors = "0.4.1" +actix-cors = "0.5.3" actix-http = "2" actix-rt = "1" actix-service = "1.0.6" -actix-web = { version = "3.1.0", features = ["rustls"] } -bytes = "0.5.4" +actix-web = { version = "3.3.2", features = ["rustls"] } +bytes = "0.6.0" chrono = { version = "0.4.19", features = ["serde"] } crossbeam-channel = "0.5.0" -env_logger = "0.7.1" +env_logger = "0.8.2" flate2 = "1.0.18" futures = "0.3.7" http = "0.2.1" @@ -37,13 +37,13 @@ meilisearch-error = { path = "../meilisearch-error", version = "0.17.0" } meilisearch-schema = { path = "../meilisearch-schema", version = "0.17.0" } meilisearch-tokenizer = {path = "../meilisearch-tokenizer", version = "0.17.0"} mime = "0.3.16" -once_cell = "1.4.1" +once_cell = "1.5.2" rand = "0.7.3" -regex = "1.4.1" +regex = "1.4.2" rustls = "0.18" serde = { version = "1.0.117", features = ["derive"] } serde_json = { version = "1.0.59", features = ["preserve_order"] } -serde_qs = "0.7.0" +serde_qs = "0.8.1" sha2 = "0.9.1" siphasher = "0.3.2" slice-group-by = "0.2.6" @@ -53,7 +53,7 @@ tempfile = "3.1.0" tokio = { version = "0.2.18", features = ["macros"] } ureq = { version = "1.5.1", features = ["tls"], default-features = false } walkdir = "2.3.1" -whoami = "0.9.0" +whoami = "1.0.0" [dependencies.sentry] version = "0.18.1" diff --git a/meilisearch-http/src/main.rs b/meilisearch-http/src/main.rs index 41b85d709..800e2760c 100644 --- a/meilisearch-http/src/main.rs +++ b/meilisearch-http/src/main.rs @@ -47,7 +47,7 @@ async fn main() -> Result<(), MainError> { } } "development" => { - env_logger::from_env(env_logger::Env::default().default_filter_or("info")).init(); + env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init(); } _ => unreachable!(), } @@ -84,11 +84,10 @@ async fn main() -> Result<(), MainError> { let http_server = HttpServer::new(move || { create_app(&data, enable_frontend) .wrap( - Cors::new() + Cors::default() .send_wildcard() .allowed_headers(vec!["content-type", "x-meili-api-key"]) .max_age(86_400) // 24h - .finish(), ) .wrap(middleware::Logger::default()) .wrap(middleware::Compress::default())