mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-25 22:34:28 +01:00
get rids of the new introduced error code in favor of an io::Error
This commit is contained in:
parent
d772073dfa
commit
c0f2724c2d
@ -47,8 +47,6 @@ pub enum InternalError {
|
|||||||
IndexingMergingKeys { process: &'static str },
|
IndexingMergingKeys { process: &'static str },
|
||||||
#[error("{}", HeedError::InvalidDatabaseTyping)]
|
#[error("{}", HeedError::InvalidDatabaseTyping)]
|
||||||
InvalidDatabaseTyping,
|
InvalidDatabaseTyping,
|
||||||
#[error("Could not access the inner of a buf-reader/writer: {0}")]
|
|
||||||
BufIntoInnerError(String),
|
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
RayonThreadPool(#[from] ThreadPoolBuildError),
|
RayonThreadPool(#[from] ThreadPoolBuildError),
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
|
@ -67,10 +67,7 @@ pub fn sorter_into_reader(
|
|||||||
pub fn writer_into_reader(
|
pub fn writer_into_reader(
|
||||||
writer: grenad::Writer<BufWriter<File>>,
|
writer: grenad::Writer<BufWriter<File>>,
|
||||||
) -> Result<grenad::Reader<BufReader<File>>> {
|
) -> Result<grenad::Reader<BufReader<File>>> {
|
||||||
let mut file = writer
|
let mut file = writer.into_inner()?.into_inner().map_err(|err| err.into_error())?;
|
||||||
.into_inner()?
|
|
||||||
.into_inner()
|
|
||||||
.map_err(|err| InternalError::BufIntoInnerError(err.to_string()))?;
|
|
||||||
file.rewind()?;
|
file.rewind()?;
|
||||||
grenad::Reader::new(BufReader::new(file)).map_err(Into::into)
|
grenad::Reader::new(BufReader::new(file)).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
@ -659,12 +659,10 @@ impl<'a, 'i> Transform<'a, 'i> {
|
|||||||
new_documents_ids: self.new_documents_ids,
|
new_documents_ids: self.new_documents_ids,
|
||||||
replaced_documents_ids: self.replaced_documents_ids,
|
replaced_documents_ids: self.replaced_documents_ids,
|
||||||
documents_count: self.documents_count,
|
documents_count: self.documents_count,
|
||||||
original_documents: original_documents
|
original_documents: original_documents.into_inner().map_err(|err| err.into_error())?,
|
||||||
.into_inner()
|
|
||||||
.map_err(|err| InternalError::BufIntoInnerError(err.to_string()))?,
|
|
||||||
flattened_documents: flattened_documents
|
flattened_documents: flattened_documents
|
||||||
.into_inner()
|
.into_inner()
|
||||||
.map_err(|err| InternalError::BufIntoInnerError(err.to_string()))?,
|
.map_err(|err| err.into_error())?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -783,12 +781,10 @@ impl<'a, 'i> Transform<'a, 'i> {
|
|||||||
new_documents_ids: documents_ids,
|
new_documents_ids: documents_ids,
|
||||||
replaced_documents_ids: RoaringBitmap::default(),
|
replaced_documents_ids: RoaringBitmap::default(),
|
||||||
documents_count,
|
documents_count,
|
||||||
original_documents: original_documents
|
original_documents: original_documents.into_inner().map_err(|err| err.into_error())?,
|
||||||
.into_inner()
|
|
||||||
.map_err(|err| InternalError::BufIntoInnerError(err.to_string()))?,
|
|
||||||
flattened_documents: flattened_documents
|
flattened_documents: flattened_documents
|
||||||
.into_inner()
|
.into_inner()
|
||||||
.map_err(|err| InternalError::BufIntoInnerError(err.to_string()))?,
|
.map_err(|err| err.into_error())?,
|
||||||
};
|
};
|
||||||
|
|
||||||
let new_facets = output.compute_real_facets(wtxn, self.index)?;
|
let new_facets = output.compute_real_facets(wtxn, self.index)?;
|
||||||
|
@ -6,7 +6,7 @@ use grenad::CompressionType;
|
|||||||
use heed::types::ByteSlice;
|
use heed::types::ByteSlice;
|
||||||
|
|
||||||
use super::index_documents::{merge_cbo_roaring_bitmaps, CursorClonableMmap};
|
use super::index_documents::{merge_cbo_roaring_bitmaps, CursorClonableMmap};
|
||||||
use crate::{Index, InternalError, Result};
|
use crate::{Index, Result};
|
||||||
|
|
||||||
mod prefix_word;
|
mod prefix_word;
|
||||||
mod word_prefix;
|
mod word_prefix;
|
||||||
@ -121,10 +121,7 @@ pub fn write_into_lmdb_database_without_merging(
|
|||||||
database: heed::PolyDatabase,
|
database: heed::PolyDatabase,
|
||||||
writer: grenad::Writer<BufWriter<std::fs::File>>,
|
writer: grenad::Writer<BufWriter<std::fs::File>>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let file = writer
|
let file = writer.into_inner()?.into_inner().map_err(|err| err.into_error())?;
|
||||||
.into_inner()?
|
|
||||||
.into_inner()
|
|
||||||
.map_err(|err| InternalError::BufIntoInnerError(err.to_string()))?;
|
|
||||||
let reader = grenad::Reader::new(BufReader::new(file))?;
|
let reader = grenad::Reader::new(BufReader::new(file))?;
|
||||||
if database.is_empty(wtxn)? {
|
if database.is_empty(wtxn)? {
|
||||||
let mut out_iter = database.iter_mut::<_, ByteSlice, ByteSlice>(wtxn)?;
|
let mut out_iter = database.iter_mut::<_, ByteSlice, ByteSlice>(wtxn)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user