From f0e804afd5687b2c074a83eb73c68d6eb674cd43 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Tue, 15 Jun 2021 11:10:50 +0200 Subject: [PATCH] Rename the FieldIdMapMissingEntry from_db_name field into process --- milli/src/error.rs | 12 ++++++------ milli/src/lib.rs | 2 +- milli/src/search/criteria/asc_desc.rs | 2 +- milli/src/search/facet/facet_distribution.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/milli/src/error.rs b/milli/src/error.rs index 096851f09..5a8dfc90b 100644 --- a/milli/src/error.rs +++ b/milli/src/error.rs @@ -43,8 +43,8 @@ pub enum SerializationError { #[derive(Debug)] pub enum FieldIdMapMissingEntry { - FieldId { field_id: FieldId, from_db_name: &'static str }, - FieldName { field_name: String, from_db_name: &'static str }, + FieldId { field_id: FieldId, process: &'static str }, + FieldName { field_name: String, process: &'static str }, } #[derive(Debug)] @@ -224,11 +224,11 @@ impl StdError for UserError {} impl fmt::Display for FieldIdMapMissingEntry { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - Self::FieldId { field_id, from_db_name } => { - write!(f, "unknown field id {} coming from {} database", field_id, from_db_name) + Self::FieldId { field_id, process } => { + write!(f, "unknown field id {} coming from the {} process", field_id, process) }, - Self::FieldName { field_name, from_db_name } => { - write!(f, "unknown field name {} coming from {} database", field_name, from_db_name) + Self::FieldName { field_name, process } => { + write!(f, "unknown field name {} coming from the {} process", field_name, process) }, } } diff --git a/milli/src/lib.rs b/milli/src/lib.rs index 6fa88ad64..f37244114 100644 --- a/milli/src/lib.rs +++ b/milli/src/lib.rs @@ -62,7 +62,7 @@ pub fn obkv_to_json( .map(|(id, value)| { let name = fields_ids_map.name(id).ok_or(error::FieldIdMapMissingEntry::FieldId { field_id: id, - from_db_name: "documents", + process: "obkv_to_json", })?; let value = serde_json::from_slice(value).map_err(error::InternalError::SerdeJson)?; Ok((name.to_owned(), value)) diff --git a/milli/src/search/criteria/asc_desc.rs b/milli/src/search/criteria/asc_desc.rs index c72781629..95f77fd78 100644 --- a/milli/src/search/criteria/asc_desc.rs +++ b/milli/src/search/criteria/asc_desc.rs @@ -61,7 +61,7 @@ impl<'t> AscDesc<'t> { .id(&field_name) .ok_or_else(|| FieldIdMapMissingEntry::FieldName { field_name: field_name.clone(), - from_db_name: "asc-desc", + process: "AscDesc::new", })?; Ok(AscDesc { diff --git a/milli/src/search/facet/facet_distribution.rs b/milli/src/search/facet/facet_distribution.rs index 917314b25..265a8ffeb 100644 --- a/milli/src/search/facet/facet_distribution.rs +++ b/milli/src/search/facet/facet_distribution.rs @@ -203,7 +203,7 @@ impl<'a> FacetDistribution<'a> { for name in filterable_fields { let fid = fields_ids_map.id(&name).ok_or_else(|| FieldIdMapMissingEntry::FieldName { field_name: name.clone(), - from_db_name: "filterable-fields", + process: "FacetDistribution::execute", })?; let values = self.facet_values(fid)?; distribution.insert(name, values);