mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
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:
parent
5bb9023722
commit
d065a3e4f0
14 changed files with 98 additions and 77 deletions
|
@ -1,5 +1,5 @@
|
|||
use std::fs::{self, File};
|
||||
use std::io::{BufRead, BufReader};
|
||||
use std::io::{BufRead, BufReader, ErrorKind};
|
||||
use std::path::Path;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -88,8 +88,11 @@ impl V4Reader {
|
|||
}
|
||||
|
||||
pub fn instance_uid(&self) -> Result<Option<Uuid>> {
|
||||
let uuid = fs::read_to_string(self.dump.path().join("instance-uid"))?;
|
||||
Ok(Some(Uuid::parse_str(&uuid)?))
|
||||
match fs::read_to_string(self.dump.path().join("instance-uid")) {
|
||||
Ok(uuid) => Ok(Some(Uuid::parse_str(&uuid)?)),
|
||||
Err(e) if e.kind() == ErrorKind::NotFound => Ok(None),
|
||||
Err(e) => Err(e.into()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn indexes(&self) -> Result<impl Iterator<Item = Result<V4IndexReader>> + '_> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue