fix the import of the dumpv4&v5 when there is no instance-uid + rename the Kind+KindWithContent+Details variant for the DocumentImport and the Setting

This commit is contained in:
Irevoire 2022-10-21 18:03:10 +02:00 committed by Clément Renault
parent 131fe30934
commit 8d1408c65e
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
14 changed files with 98 additions and 77 deletions

View file

@ -43,12 +43,12 @@ impl AutobatchKind {
impl From<KindWithContent> for AutobatchKind {
fn from(kind: KindWithContent) -> Self {
match kind {
KindWithContent::DocumentImport { method, allow_index_creation, .. } => {
KindWithContent::DocumentAdditionOrUpdate { method, allow_index_creation, .. } => {
AutobatchKind::DocumentImport { method, allow_index_creation }
}
KindWithContent::DocumentDeletion { .. } => AutobatchKind::DocumentDeletion,
KindWithContent::DocumentClear { .. } => AutobatchKind::DocumentClear,
KindWithContent::Settings { allow_index_creation, is_deletion, .. } => {
KindWithContent::SettingsUpdate { allow_index_creation, is_deletion, .. } => {
AutobatchKind::Settings {
allow_index_creation: allow_index_creation && !is_deletion,
}
@ -449,7 +449,7 @@ mod tests {
}
fn doc_imp(method: IndexDocumentsMethod, allow_index_creation: bool) -> KindWithContent {
KindWithContent::DocumentImport {
KindWithContent::DocumentAdditionOrUpdate {
index_uid: String::from("doggo"),
primary_key: None,
method,
@ -471,7 +471,7 @@ mod tests {
}
fn settings(allow_index_creation: bool) -> KindWithContent {
KindWithContent::Settings {
KindWithContent::SettingsUpdate {
index_uid: String::from("doggo"),
new_settings: Default::default(),
is_deletion: false,