mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 09:04:59 +08:00
Merge #465
465: Update dependencies r=ManyTheFish a=Kerollmops This PR upgrade and updates this crate's dependencies but first, it removes three dependencies that we don't use anymore. I used [cargo udeps](https://github.com/est31/cargo-udeps) to upgrade them ⬆️ Co-authored-by: Kerollmops <clement@meilisearch.com> Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
commit
d87e8b63a9
@ -6,8 +6,8 @@ publish = false
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
milli = { path = "../milli" }
|
milli = { path = "../milli" }
|
||||||
anyhow = "1.0"
|
anyhow = "1.0.56"
|
||||||
serde_json = { version = "1.0.62", features = ["preserve_order"] }
|
serde_json = { version = "1.0.79", features = ["preserve_order"] }
|
||||||
csv = "1.1.6"
|
csv = "1.1.6"
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
@ -15,14 +15,14 @@ jemallocator = "0.3.2"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
||||||
criterion = { version = "0.3.4", features = ["html_reports"] }
|
criterion = { version = "0.3.5", features = ["html_reports"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0.56"
|
||||||
bytes = "1.0"
|
bytes = "1.1.0"
|
||||||
flate2 = "1.0.20"
|
flate2 = "1.0.22"
|
||||||
convert_case = "0.4"
|
convert_case = "0.5.0"
|
||||||
reqwest = { version = "0.11.3", features = ["blocking", "rustls-tls"], default-features = false }
|
reqwest = { version = "0.11.9", features = ["blocking", "rustls-tls"], default-features = false }
|
||||||
|
|
||||||
[[bench]]
|
[[bench]]
|
||||||
name = "search_songs"
|
name = "search_songs"
|
||||||
|
@ -8,15 +8,15 @@ description = "A CLI to interact with a milli index"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
indicatif = "0.16.2"
|
indicatif = "0.16.2"
|
||||||
serde = "1.0.129"
|
serde = "1.0.136"
|
||||||
serde_json = "1.0.66"
|
serde_json = "1.0.79"
|
||||||
structopt = "0.3.22"
|
structopt = "0.3.26"
|
||||||
milli = { path = "../milli" }
|
milli = { path = "../milli" }
|
||||||
eyre = "0.6.5"
|
eyre = "0.6.7"
|
||||||
color-eyre = "0.5.11"
|
color-eyre = "0.6.1"
|
||||||
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1", default-features = false, features = ["lmdb", "sync-read-txn"] }
|
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1", default-features = false, features = ["lmdb", "sync-read-txn"] }
|
||||||
byte-unit = { version = "4.0.12", features = ["serde"] }
|
byte-unit = { version = "4.0.14", features = ["serde"] }
|
||||||
bimap = "0.6.1"
|
bimap = "0.6.2"
|
||||||
csv = "1.1.6"
|
csv = "1.1.6"
|
||||||
stderrlog = "0.5.1"
|
stderrlog = "0.5.1"
|
||||||
|
|
||||||
|
@ -6,5 +6,5 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nom = "7.0.0"
|
nom = "7.1.0"
|
||||||
nom_locate = "4.0.0"
|
nom_locate = "4.0.0"
|
||||||
|
@ -5,12 +5,12 @@ authors = ["Clément Renault <clement@meilisearch.com>"]
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.38"
|
anyhow = "1.0.56"
|
||||||
byte-unit = { version = "4.0.9", default-features = false, features = ["std"] }
|
byte-unit = { version = "4.0.14", default-features = false, features = ["std"] }
|
||||||
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
||||||
milli = { path = "../milli" }
|
milli = { path = "../milli" }
|
||||||
stderrlog = "0.5.1"
|
stderrlog = "0.5.1"
|
||||||
structopt = { version = "0.3.21", default-features = false }
|
structopt = { version = "0.3.26", default-features = false }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
jemallocator = "0.3.2"
|
jemallocator = "0.3.2"
|
||||||
|
@ -6,43 +6,43 @@ authors = ["Clément Renault <clement@meilisearch.com>"]
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.38"
|
anyhow = "1.0.56"
|
||||||
byte-unit = { version = "4.0.9", default-features = false, features = ["std"] }
|
byte-unit = { version = "4.0.14", default-features = false, features = ["std"] }
|
||||||
crossbeam-channel = "0.5.0"
|
crossbeam-channel = "0.5.2"
|
||||||
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
||||||
meilisearch-tokenizer = { git = "https://github.com/meilisearch/tokenizer.git", tag = "v0.2.7" }
|
memmap2 = "0.5.3"
|
||||||
memmap2 = "0.5.0"
|
|
||||||
milli = { path = "../milli" }
|
milli = { path = "../milli" }
|
||||||
once_cell = "1.5.2"
|
once_cell = "1.10.0"
|
||||||
rayon = "1.5.0"
|
rayon = "1.5.1"
|
||||||
structopt = { version = "0.3.21", default-features = false, features = ["wrap_help"] }
|
structopt = { version = "0.3.26", default-features = false, features = ["wrap_help"] }
|
||||||
tempfile = "3.2.0"
|
tempfile = "3.3.0"
|
||||||
|
|
||||||
# http server
|
# http server
|
||||||
askama = "0.10.5"
|
askama = "0.11.1"
|
||||||
askama_warp = "0.10.0"
|
askama_warp = "0.12.0"
|
||||||
bytes = "0.5.6"
|
bytes = "1.1.0"
|
||||||
either = "1.6.1"
|
either = "1.6.1"
|
||||||
flate2 = "1.0.20"
|
flate2 = "1.0.22"
|
||||||
futures = "0.3.12"
|
futures = "0.3.21"
|
||||||
serde = { version = "1.0.123", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
serde_json = { version = "1.0.62", features = ["preserve_order"] }
|
serde_json = { version = "1.0.79", features = ["preserve_order"] }
|
||||||
tokio = { version = "0.2.25", features = ["full"] }
|
tokio = { version = "1.17.0", features = ["full"] }
|
||||||
warp = "0.2.5"
|
tokio-stream = { version = "0.1.8", default-features = false, features = ["sync"] }
|
||||||
|
warp = "0.3.2"
|
||||||
|
|
||||||
# logging
|
# logging
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
stderrlog = "0.5.1"
|
stderrlog = "0.5.1"
|
||||||
fst = "0.4.5"
|
fst = "0.4.7"
|
||||||
|
|
||||||
# Temporary fix for bitvec, remove once fixed. (https://github.com/bitvecto-rs/bitvec/issues/105)
|
# Temporary fix for bitvec, remove once fixed. (https://github.com/bitvecto-rs/bitvec/issues/105)
|
||||||
funty = "=1.1"
|
funty = "2.0.0"
|
||||||
bimap = "0.6.1"
|
bimap = "0.6.2"
|
||||||
csv = "1.1.6"
|
csv = "1.1.6"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
maplit = "1.0.2"
|
maplit = "1.0.2"
|
||||||
serde_test = "1.0.125"
|
serde_test = "1.0.136"
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
jemallocator = "0.3.2"
|
jemallocator = "0.3.2"
|
||||||
|
@ -3,7 +3,7 @@ mod update_store;
|
|||||||
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::fs::{create_dir_all, File};
|
use std::fs::{create_dir_all, File};
|
||||||
use std::io::{BufRead, BufReader, Cursor};
|
use std::io::{BufRead, BufReader, Cursor, Read};
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::num::{NonZeroU32, NonZeroUsize};
|
use std::num::{NonZeroU32, NonZeroUsize};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
@ -18,8 +18,8 @@ use either::Either;
|
|||||||
use flate2::read::GzDecoder;
|
use flate2::read::GzDecoder;
|
||||||
use futures::{stream, FutureExt, StreamExt};
|
use futures::{stream, FutureExt, StreamExt};
|
||||||
use heed::EnvOpenOptions;
|
use heed::EnvOpenOptions;
|
||||||
use meilisearch_tokenizer::{Analyzer, AnalyzerConfig};
|
|
||||||
use milli::documents::DocumentBatchReader;
|
use milli::documents::DocumentBatchReader;
|
||||||
|
use milli::tokenizer::{Analyzer, AnalyzerConfig};
|
||||||
use milli::update::UpdateIndexingStep::*;
|
use milli::update::UpdateIndexingStep::*;
|
||||||
use milli::update::{
|
use milli::update::{
|
||||||
ClearDocuments, IndexDocumentsConfig, IndexDocumentsMethod, IndexerConfig, Setting,
|
ClearDocuments, IndexDocumentsConfig, IndexDocumentsMethod, IndexerConfig, Setting,
|
||||||
@ -35,6 +35,7 @@ use structopt::StructOpt;
|
|||||||
use tokio::fs::File as TFile;
|
use tokio::fs::File as TFile;
|
||||||
use tokio::io::AsyncWriteExt;
|
use tokio::io::AsyncWriteExt;
|
||||||
use tokio::sync::broadcast;
|
use tokio::sync::broadcast;
|
||||||
|
use tokio_stream::wrappers::BroadcastStream;
|
||||||
use warp::filters::ws::Message;
|
use warp::filters::ws::Message;
|
||||||
use warp::http::Response;
|
use warp::http::Response;
|
||||||
use warp::Filter;
|
use warp::Filter;
|
||||||
@ -885,7 +886,8 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
let mut file = TFile::from_std(file);
|
let mut file = TFile::from_std(file);
|
||||||
|
|
||||||
while let Some(result) = stream.next().await {
|
while let Some(result) = stream.next().await {
|
||||||
let bytes = result.unwrap().to_bytes();
|
let mut bytes = Vec::new();
|
||||||
|
result.unwrap().reader().read_to_end(&mut bytes).unwrap();
|
||||||
file.write_all(&bytes[..]).await.unwrap();
|
file.write_all(&bytes[..]).await.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1004,8 +1006,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
let update_status_receiver = update_status_sender.subscribe();
|
let update_status_receiver = update_status_sender.subscribe();
|
||||||
ws.on_upgrade(|websocket| {
|
ws.on_upgrade(|websocket| {
|
||||||
// Just echo all updates messages...
|
// Just echo all updates messages...
|
||||||
update_status_receiver
|
BroadcastStream::new(update_status_receiver)
|
||||||
.into_stream()
|
|
||||||
.flat_map(|result| match result {
|
.flat_map(|result| match result {
|
||||||
Ok(status) => {
|
Ok(status) => {
|
||||||
let msg = serde_json::to_string(&status).unwrap();
|
let msg = serde_json::to_string(&status).unwrap();
|
||||||
|
@ -5,15 +5,15 @@ authors = ["Clément Renault <clement@meilisearch.com>"]
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.38"
|
anyhow = "1.0.56"
|
||||||
byte-unit = { version = "4.0.9", default-features = false, features = ["std"] }
|
byte-unit = { version = "4.0.14", default-features = false, features = ["std"] }
|
||||||
csv = "1.1.5"
|
csv = "1.1.6"
|
||||||
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1" }
|
||||||
milli = { path = "../milli" }
|
milli = { path = "../milli" }
|
||||||
roaring = "0.6.6"
|
roaring = "0.9.0"
|
||||||
serde_json = "1.0.62"
|
serde_json = "1.0.79"
|
||||||
stderrlog = "0.5.1"
|
stderrlog = "0.5.1"
|
||||||
structopt = { version = "0.3.21", default-features = false }
|
structopt = { version = "0.3.26", default-features = false }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
jemallocator = "0.3.2"
|
jemallocator = "0.3.2"
|
||||||
|
@ -5,53 +5,50 @@ authors = ["Kerollmops <clement@meilisearch.com>"]
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bimap = { version = "0.6.1", features = ["serde"] }
|
bimap = { version = "0.6.2", features = ["serde"] }
|
||||||
bincode = "1.3.3"
|
bincode = "1.3.3"
|
||||||
bstr = "0.2.15"
|
bstr = "0.2.17"
|
||||||
byteorder = "1.4.2"
|
byteorder = "1.4.3"
|
||||||
concat-arrays = "0.1.2"
|
concat-arrays = "0.1.2"
|
||||||
crossbeam-channel = "0.5.1"
|
crossbeam-channel = "0.5.2"
|
||||||
either = "1.6.1"
|
either = "1.6.1"
|
||||||
flate2 = "1.0.20"
|
fst = "0.4.7"
|
||||||
fst = "0.4.5"
|
|
||||||
fxhash = "0.2.1"
|
fxhash = "0.2.1"
|
||||||
grenad = { version = "0.4.1", default-features = false, features = ["tempfile"] }
|
grenad = { version = "0.4.1", default-features = false, features = ["tempfile"] }
|
||||||
geoutils = "0.4.1"
|
geoutils = "0.4.1"
|
||||||
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1", default-features = false, features = ["lmdb", "sync-read-txn"] }
|
heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.1", default-features = false, features = ["lmdb", "sync-read-txn"] }
|
||||||
human_format = "1.0.3"
|
levenshtein_automata = { version = "0.2.1", features = ["fst_automaton"] }
|
||||||
levenshtein_automata = { version = "0.2.0", features = ["fst_automaton"] }
|
meilisearch-tokenizer = { git = "https://github.com/meilisearch/tokenizer.git", tag = "v0.2.8" }
|
||||||
linked-hash-map = "0.5.4"
|
memmap2 = "0.5.3"
|
||||||
meilisearch-tokenizer = { git = "https://github.com/meilisearch/tokenizer.git", tag = "v0.2.7" }
|
|
||||||
memmap2 = "0.5.0"
|
|
||||||
obkv = "0.2.0"
|
obkv = "0.2.0"
|
||||||
once_cell = "1.5.2"
|
once_cell = "1.10.0"
|
||||||
ordered-float = "2.1.1"
|
ordered-float = "2.10.0"
|
||||||
rayon = "1.5.0"
|
rayon = "1.5.1"
|
||||||
roaring = "0.6.6"
|
roaring = "0.9.0"
|
||||||
rstar = { version = "0.9.1", features = ["serde"] }
|
rstar = { version = "0.9.2", features = ["serde"] }
|
||||||
serde = { version = "1.0.123", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
serde_json = { version = "1.0.62", features = ["preserve_order"] }
|
serde_json = { version = "1.0.79", features = ["preserve_order"] }
|
||||||
slice-group-by = "0.2.6"
|
slice-group-by = "0.3.0"
|
||||||
smallstr = { version = "0.2.0", features = ["serde"] }
|
smallstr = { version = "0.3.0", features = ["serde"] }
|
||||||
smallvec = "1.6.1"
|
smallvec = "1.8.0"
|
||||||
tempfile = "3.2.0"
|
tempfile = "3.3.0"
|
||||||
time = { version = "0.3.7", features = ["serde-well-known", "formatting", "parsing", "macros"] }
|
time = { version = "0.3.7", features = ["serde-well-known", "formatting", "parsing", "macros"] }
|
||||||
uuid = { version = "0.8.2", features = ["v4"] }
|
uuid = { version = "0.8.2", features = ["v4"] }
|
||||||
|
|
||||||
filter-parser = { path = "../filter-parser" }
|
filter-parser = { path = "../filter-parser" }
|
||||||
|
|
||||||
# documents words self-join
|
# documents words self-join
|
||||||
itertools = "0.10.0"
|
itertools = "0.10.3"
|
||||||
|
|
||||||
# logging
|
# logging
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
logging_timer = "1.0.0"
|
logging_timer = "1.1.0"
|
||||||
csv = "1.1.6"
|
csv = "1.1.6"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
big_s = "1.0.2"
|
big_s = "1.0.2"
|
||||||
maplit = "1.0.2"
|
maplit = "1.0.2"
|
||||||
rand = "0.8.3"
|
rand = "0.8.5"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
@ -82,7 +82,8 @@ impl CboRoaringBitmapCodec {
|
|||||||
buffer.extend_from_slice(&integer.to_ne_bytes());
|
buffer.extend_from_slice(&integer.to_ne_bytes());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let roaring = RoaringBitmap::from_sorted_iter(vec.into_iter());
|
// We can unwrap safely because the vector is sorted upper.
|
||||||
|
let roaring = RoaringBitmap::from_sorted_iter(vec.into_iter()).unwrap();
|
||||||
roaring.serialize_into(buffer)?;
|
roaring.serialize_into(buffer)?;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -152,25 +153,25 @@ mod tests {
|
|||||||
let mut buffer = Vec::new();
|
let mut buffer = Vec::new();
|
||||||
|
|
||||||
let small_data = vec![
|
let small_data = vec![
|
||||||
RoaringBitmap::from_sorted_iter(1..4),
|
RoaringBitmap::from_sorted_iter(1..4).unwrap(),
|
||||||
RoaringBitmap::from_sorted_iter(2..5),
|
RoaringBitmap::from_sorted_iter(2..5).unwrap(),
|
||||||
RoaringBitmap::from_sorted_iter(4..6),
|
RoaringBitmap::from_sorted_iter(4..6).unwrap(),
|
||||||
RoaringBitmap::from_sorted_iter(1..3),
|
RoaringBitmap::from_sorted_iter(1..3).unwrap(),
|
||||||
];
|
];
|
||||||
|
|
||||||
let small_data: Vec<_> =
|
let small_data: Vec<_> =
|
||||||
small_data.iter().map(|b| CboRoaringBitmapCodec::bytes_encode(b).unwrap()).collect();
|
small_data.iter().map(|b| CboRoaringBitmapCodec::bytes_encode(b).unwrap()).collect();
|
||||||
CboRoaringBitmapCodec::merge_into(small_data.as_slice(), &mut buffer).unwrap();
|
CboRoaringBitmapCodec::merge_into(small_data.as_slice(), &mut buffer).unwrap();
|
||||||
let bitmap = CboRoaringBitmapCodec::deserialize_from(&buffer).unwrap();
|
let bitmap = CboRoaringBitmapCodec::deserialize_from(&buffer).unwrap();
|
||||||
let expected = RoaringBitmap::from_sorted_iter(1..6);
|
let expected = RoaringBitmap::from_sorted_iter(1..6).unwrap();
|
||||||
assert_eq!(bitmap, expected);
|
assert_eq!(bitmap, expected);
|
||||||
|
|
||||||
let medium_data = vec![
|
let medium_data = vec![
|
||||||
RoaringBitmap::from_sorted_iter(1..4),
|
RoaringBitmap::from_sorted_iter(1..4).unwrap(),
|
||||||
RoaringBitmap::from_sorted_iter(2..5),
|
RoaringBitmap::from_sorted_iter(2..5).unwrap(),
|
||||||
RoaringBitmap::from_sorted_iter(4..8),
|
RoaringBitmap::from_sorted_iter(4..8).unwrap(),
|
||||||
RoaringBitmap::from_sorted_iter(0..3),
|
RoaringBitmap::from_sorted_iter(0..3).unwrap(),
|
||||||
RoaringBitmap::from_sorted_iter(7..23),
|
RoaringBitmap::from_sorted_iter(7..23).unwrap(),
|
||||||
];
|
];
|
||||||
|
|
||||||
let medium_data: Vec<_> =
|
let medium_data: Vec<_> =
|
||||||
@ -179,7 +180,7 @@ mod tests {
|
|||||||
CboRoaringBitmapCodec::merge_into(medium_data.as_slice(), &mut buffer).unwrap();
|
CboRoaringBitmapCodec::merge_into(medium_data.as_slice(), &mut buffer).unwrap();
|
||||||
|
|
||||||
let bitmap = CboRoaringBitmapCodec::deserialize_from(&buffer).unwrap();
|
let bitmap = CboRoaringBitmapCodec::deserialize_from(&buffer).unwrap();
|
||||||
let expected = RoaringBitmap::from_sorted_iter(0..23);
|
let expected = RoaringBitmap::from_sorted_iter(0..23).unwrap();
|
||||||
assert_eq!(bitmap, expected);
|
assert_eq!(bitmap, expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -498,6 +498,7 @@ fn query_pair_proximity_docids(
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub mod test {
|
pub mod test {
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::iter;
|
||||||
|
|
||||||
use maplit::hashmap;
|
use maplit::hashmap;
|
||||||
use rand::rngs::StdRng;
|
use rand::rngs::StdRng;
|
||||||
@ -567,7 +568,8 @@ pub mod test {
|
|||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, w)| {
|
.map(|(i, w)| {
|
||||||
(w.clone(), RoaringBitmap::from_sorted_iter(std::iter::once(i as u32)))
|
let bitmap = RoaringBitmap::from_sorted_iter(iter::once(i as u32)).unwrap();
|
||||||
|
(w.clone(), bitmap)
|
||||||
})
|
})
|
||||||
.collect())
|
.collect())
|
||||||
} else {
|
} else {
|
||||||
@ -622,7 +624,7 @@ pub mod test {
|
|||||||
}
|
}
|
||||||
values.sort_unstable();
|
values.sort_unstable();
|
||||||
|
|
||||||
RoaringBitmap::from_sorted_iter(values.into_iter())
|
RoaringBitmap::from_sorted_iter(values.into_iter()).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
let word_docids = hashmap! {
|
let word_docids = hashmap! {
|
||||||
|
@ -587,8 +587,7 @@ mod test {
|
|||||||
values.push(rng.gen());
|
values.push(rng.gen());
|
||||||
}
|
}
|
||||||
values.sort_unstable();
|
values.sort_unstable();
|
||||||
|
RoaringBitmap::from_sorted_iter(values.into_iter()).unwrap()
|
||||||
RoaringBitmap::from_sorted_iter(values.into_iter())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TestContext {
|
TestContext {
|
||||||
|
@ -186,7 +186,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> {
|
|||||||
|
|
||||||
// We create the FST map of the external ids that we must delete.
|
// We create the FST map of the external ids that we must delete.
|
||||||
external_ids.sort_unstable();
|
external_ids.sort_unstable();
|
||||||
let external_ids_to_delete = fst::Set::from_iter(external_ids.iter().map(AsRef::as_ref))?;
|
let external_ids_to_delete = fst::Set::from_iter(external_ids)?;
|
||||||
|
|
||||||
// We acquire the current external documents ids map...
|
// We acquire the current external documents ids map...
|
||||||
let mut new_external_documents_ids = self.index.external_documents_ids(self.wtxn)?;
|
let mut new_external_documents_ids = self.index.external_documents_ids(self.wtxn)?;
|
||||||
@ -209,7 +209,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> {
|
|||||||
// the LMDB B-Tree two times but only once.
|
// the LMDB B-Tree two times but only once.
|
||||||
let mut iter = word_docids.prefix_iter_mut(self.wtxn, &word)?;
|
let mut iter = word_docids.prefix_iter_mut(self.wtxn, &word)?;
|
||||||
if let Some((key, mut docids)) = iter.next().transpose()? {
|
if let Some((key, mut docids)) = iter.next().transpose()? {
|
||||||
if key == word.as_ref() {
|
if key == word.as_str() {
|
||||||
let previous_len = docids.len();
|
let previous_len = docids.len();
|
||||||
docids -= &self.documents_ids;
|
docids -= &self.documents_ids;
|
||||||
if docids.is_empty() {
|
if docids.is_empty() {
|
||||||
@ -230,7 +230,7 @@ impl<'t, 'u, 'i> DeleteDocuments<'t, 'u, 'i> {
|
|||||||
words.iter().filter_map(
|
words.iter().filter_map(
|
||||||
|(word, must_remove)| {
|
|(word, must_remove)| {
|
||||||
if *must_remove {
|
if *must_remove {
|
||||||
Some(word.as_ref())
|
Some(word.as_str())
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user