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,
|
||||
DocumentDeletionByFilter {
|
||||
filter: String,
|
||||
filter: serde_json::Value,
|
||||
},
|
||||
Settings {
|
||||
settings: Box<meilisearch_types::settings::Settings<Unchecked>>,
|
||||
@ -170,7 +170,7 @@ impl From<KindWithContent> for KindDump {
|
||||
KindDump::DocumentDeletion { documents_ids }
|
||||
}
|
||||
KindWithContent::DocumentDeletionByFilter { filter_expr, .. } => {
|
||||
KindDump::DocumentDeletionByFilter { filter: filter_expr.to_string() }
|
||||
KindDump::DocumentDeletionByFilter { filter: filter_expr }
|
||||
}
|
||||
KindWithContent::DocumentClear { .. } => KindDump::DocumentClear,
|
||||
KindWithContent::SettingsUpdate {
|
||||
|
@ -1210,8 +1210,7 @@ impl<'a> Dump<'a> {
|
||||
},
|
||||
KindDump::DocumentDeletionByFilter { filter } => {
|
||||
KindWithContent::DocumentDeletionByFilter {
|
||||
filter_expr: serde_json::from_str(&filter)
|
||||
.map_err(|_| Error::CorruptedDump)?,
|
||||
filter_expr: filter,
|
||||
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)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum KindWithContent {
|
||||
|
Loading…
Reference in New Issue
Block a user