mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
feat: Introduce documents addition using the update system
This commit is contained in:
parent
5a9e25c315
commit
f83d6df4ef
7 changed files with 186 additions and 192 deletions
|
@ -6,7 +6,6 @@ use std::io::{self, BufRead, BufReader};
|
|||
use std::path::{Path, PathBuf};
|
||||
use std::time::Instant;
|
||||
use std::error::Error;
|
||||
use std::borrow::Cow;
|
||||
use std::fs::File;
|
||||
|
||||
use diskus::Walk;
|
||||
|
@ -44,9 +43,8 @@ pub struct Opt {
|
|||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct Document<'a> (
|
||||
#[serde(borrow)]
|
||||
HashMap<Cow<'a, str>, Cow<'a, str>>
|
||||
struct Document (
|
||||
HashMap<String, String>
|
||||
);
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
@ -138,7 +136,7 @@ fn index(
|
|||
}
|
||||
};
|
||||
|
||||
update.update_document(&document)?;
|
||||
update.update_document(document);
|
||||
|
||||
print!("\rindexing document {}", i);
|
||||
i += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue