mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Working first implementation
This commit is contained in:
parent
e74c3b692a
commit
e023ee4b6b
15 changed files with 298 additions and 103 deletions
|
@ -1,12 +1,16 @@
|
|||
#![allow(clippy::type_complexity)]
|
||||
#![allow(clippy::wrong_self_convention)]
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use meilisearch_types::batches::BatchId;
|
||||
use meilisearch_types::error::ResponseError;
|
||||
use meilisearch_types::keys::Key;
|
||||
use meilisearch_types::milli::update::IndexDocumentsMethod;
|
||||
use meilisearch_types::settings::Unchecked;
|
||||
use meilisearch_types::tasks::{Details, IndexSwap, KindWithContent, Status, Task, TaskId};
|
||||
use meilisearch_types::tasks::{
|
||||
Details, ExportIndexSettings, IndexSwap, KindWithContent, Status, Task, TaskId,
|
||||
};
|
||||
use meilisearch_types::InstanceUid;
|
||||
use roaring::RoaringBitmap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -143,9 +147,8 @@ pub enum KindDump {
|
|||
SnapshotCreation,
|
||||
Export {
|
||||
url: String,
|
||||
indexes: Vec<String>,
|
||||
skip_embeddings: bool,
|
||||
api_key: Option<String>,
|
||||
indexes: BTreeMap<String, ExportIndexSettings>,
|
||||
},
|
||||
UpgradeDatabase {
|
||||
from: (u32, u32, u32),
|
||||
|
@ -219,14 +222,14 @@ impl From<KindWithContent> for KindDump {
|
|||
KindDump::DumpCreation { keys, instance_uid }
|
||||
}
|
||||
KindWithContent::SnapshotCreation => KindDump::SnapshotCreation,
|
||||
KindWithContent::Export { url, indexes, skip_embeddings, api_key } => {
|
||||
KindDump::Export {
|
||||
url,
|
||||
indexes: indexes.into_iter().map(|pattern| pattern.to_string()).collect(),
|
||||
skip_embeddings,
|
||||
api_key,
|
||||
}
|
||||
}
|
||||
KindWithContent::Export { url, api_key, indexes } => KindDump::Export {
|
||||
url,
|
||||
api_key,
|
||||
indexes: indexes
|
||||
.into_iter()
|
||||
.map(|(pattern, settings)| (pattern.to_string(), settings))
|
||||
.collect(),
|
||||
},
|
||||
KindWithContent::UpgradeDatabase { from: version } => {
|
||||
KindDump::UpgradeDatabase { from: version }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue