mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-12 22:36:29 +01:00
Use a nonrandom hasher when decoding NDJSON
This commit is contained in:
parent
69c931334f
commit
93fbdc06d3
9
Cargo.lock
generated
9
Cargo.lock
generated
@ -3577,6 +3577,7 @@ dependencies = [
|
|||||||
"memmap2",
|
"memmap2",
|
||||||
"milli",
|
"milli",
|
||||||
"roaring",
|
"roaring",
|
||||||
|
"rustc-hash 2.1.0",
|
||||||
"serde",
|
"serde",
|
||||||
"serde-cs",
|
"serde-cs",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
@ -3676,7 +3677,7 @@ dependencies = [
|
|||||||
"rhai",
|
"rhai",
|
||||||
"roaring",
|
"roaring",
|
||||||
"rstar",
|
"rstar",
|
||||||
"rustc-hash 2.0.0",
|
"rustc-hash 2.1.0",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"slice-group-by",
|
"slice-group-by",
|
||||||
@ -4425,7 +4426,7 @@ dependencies = [
|
|||||||
"bytes",
|
"bytes",
|
||||||
"rand",
|
"rand",
|
||||||
"ring",
|
"ring",
|
||||||
"rustc-hash 2.0.0",
|
"rustc-hash 2.1.0",
|
||||||
"rustls",
|
"rustls",
|
||||||
"slab",
|
"slab",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@ -4798,9 +4799,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc-hash"
|
name = "rustc-hash"
|
||||||
version = "2.0.0"
|
version = "2.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
|
checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
|
@ -26,6 +26,7 @@ memmap2 = "0.9.4"
|
|||||||
milli = { path = "../milli" }
|
milli = { path = "../milli" }
|
||||||
bumparaw-collections = "0.1.2"
|
bumparaw-collections = "0.1.2"
|
||||||
roaring = { version = "0.10.7", features = ["serde"] }
|
roaring = { version = "0.10.7", features = ["serde"] }
|
||||||
|
rustc-hash = "2.1.0"
|
||||||
serde = { version = "1.0.204", features = ["derive"] }
|
serde = { version = "1.0.204", features = ["derive"] }
|
||||||
serde-cs = "0.2.4"
|
serde-cs = "0.2.4"
|
||||||
serde_json = "1.0.120"
|
serde_json = "1.0.120"
|
||||||
|
@ -8,6 +8,7 @@ use bumparaw_collections::RawMap;
|
|||||||
use memmap2::Mmap;
|
use memmap2::Mmap;
|
||||||
use milli::documents::Error;
|
use milli::documents::Error;
|
||||||
use milli::Object;
|
use milli::Object;
|
||||||
|
use rustc_hash::FxBuildHasher;
|
||||||
use serde::de::{SeqAccess, Visitor};
|
use serde::de::{SeqAccess, Visitor};
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{Deserialize, Deserializer};
|
||||||
use serde_json::error::Category;
|
use serde_json::error::Category;
|
||||||
@ -263,7 +264,7 @@ pub fn read_ndjson(input: &File) -> Result<u64> {
|
|||||||
match result {
|
match result {
|
||||||
Ok(raw) => {
|
Ok(raw) => {
|
||||||
// try to deserialize as a map
|
// try to deserialize as a map
|
||||||
RawMap::from_raw_value(raw, &bump)
|
RawMap::from_raw_value_and_hasher(raw, FxBuildHasher, &bump)
|
||||||
.map_err(|e| DocumentFormatError::from((PayloadType::Ndjson, e)))?;
|
.map_err(|e| DocumentFormatError::from((PayloadType::Ndjson, e)))?;
|
||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user