mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Make the Transform read from an EnrichedDocumentsBatchReader
This commit is contained in:
parent
ea852200bb
commit
6a0a0ae94f
7 changed files with 158 additions and 24 deletions
|
@ -7,7 +7,7 @@ use rayon::ThreadPoolBuildError;
|
|||
use serde_json::Value;
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::documents::DocumentsBatchCursorError;
|
||||
use crate::documents::{self, DocumentsBatchCursorError};
|
||||
use crate::{CriterionError, DocumentId, FieldId, Object, SortError};
|
||||
|
||||
pub fn is_reserved_keyword(keyword: &str) -> bool {
|
||||
|
@ -36,6 +36,8 @@ pub enum InternalError {
|
|||
FieldIdMappingMissingEntry { key: FieldId },
|
||||
#[error(transparent)]
|
||||
Fst(#[from] fst::Error),
|
||||
#[error(transparent)]
|
||||
DocumentsError(#[from] documents::Error),
|
||||
#[error("Invalid compression type have been specified to grenad.")]
|
||||
GrenadInvalidCompressionType,
|
||||
#[error("Invalid grenad file with an invalid version format.")]
|
||||
|
@ -185,6 +187,7 @@ macro_rules! error_from_sub_error {
|
|||
error_from_sub_error! {
|
||||
FieldIdMapMissingEntry => InternalError,
|
||||
fst::Error => InternalError,
|
||||
documents::Error => InternalError,
|
||||
str::Utf8Error => InternalError,
|
||||
ThreadPoolBuildError => InternalError,
|
||||
SerializationError => InternalError,
|
||||
|
@ -212,7 +215,10 @@ where
|
|||
|
||||
impl From<DocumentsBatchCursorError> for Error {
|
||||
fn from(error: DocumentsBatchCursorError) -> Error {
|
||||
Error::from(Into::<grenad::Error>::into(error))
|
||||
match error {
|
||||
DocumentsBatchCursorError::Grenad(e) => Error::from(e),
|
||||
DocumentsBatchCursorError::Utf8(e) => Error::from(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue