mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 03:55:07 +08:00
handle the array of array form of filter in the dumps
This commit is contained in:
parent
fc8c1d118d
commit
0f0cd2d929
@ -102,7 +102,7 @@ pub enum KindDump {
|
|||||||
},
|
},
|
||||||
DocumentClear,
|
DocumentClear,
|
||||||
DocumentDeletionByFilter {
|
DocumentDeletionByFilter {
|
||||||
filter: String,
|
filter: serde_json::Value,
|
||||||
},
|
},
|
||||||
Settings {
|
Settings {
|
||||||
settings: Box<meilisearch_types::settings::Settings<Unchecked>>,
|
settings: Box<meilisearch_types::settings::Settings<Unchecked>>,
|
||||||
@ -170,7 +170,7 @@ impl From<KindWithContent> for KindDump {
|
|||||||
KindDump::DocumentDeletion { documents_ids }
|
KindDump::DocumentDeletion { documents_ids }
|
||||||
}
|
}
|
||||||
KindWithContent::DocumentDeletionByFilter { filter_expr, .. } => {
|
KindWithContent::DocumentDeletionByFilter { filter_expr, .. } => {
|
||||||
KindDump::DocumentDeletionByFilter { filter: filter_expr.to_string() }
|
KindDump::DocumentDeletionByFilter { filter: filter_expr }
|
||||||
}
|
}
|
||||||
KindWithContent::DocumentClear { .. } => KindDump::DocumentClear,
|
KindWithContent::DocumentClear { .. } => KindDump::DocumentClear,
|
||||||
KindWithContent::SettingsUpdate {
|
KindWithContent::SettingsUpdate {
|
||||||
|
@ -1210,8 +1210,7 @@ impl<'a> Dump<'a> {
|
|||||||
},
|
},
|
||||||
KindDump::DocumentDeletionByFilter { filter } => {
|
KindDump::DocumentDeletionByFilter { filter } => {
|
||||||
KindWithContent::DocumentDeletionByFilter {
|
KindWithContent::DocumentDeletionByFilter {
|
||||||
filter_expr: serde_json::from_str(&filter)
|
filter_expr: filter,
|
||||||
.map_err(|_| Error::CorruptedDump)?,
|
|
||||||
index_uid: task.index_uid.ok_or(Error::CorruptedDump)?,
|
index_uid: task.index_uid.ok_or(Error::CorruptedDump)?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,11 +83,6 @@ impl Task {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum DocumentDeletionContent {
|
|
||||||
ByDocumentIds(Vec<String>),
|
|
||||||
ByFilter(serde_json::Value),
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub enum KindWithContent {
|
pub enum KindWithContent {
|
||||||
|
Loading…
Reference in New Issue
Block a user