mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-30 23:13:09 +08:00
Merge #462
462: cli improvements r=Kerollmops a=MarinPostma a few improvements: - use bufreader to load documents, so the loading of the document doesn't appear on flamegraphs - set default db path to current directory so the `-i` flag can be omitted. Co-authored-by: ad hoc <postma.marin@protonmail.com>
This commit is contained in:
commit
3cbadf92b6
@ -23,7 +23,7 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
|||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
#[structopt(name = "Milli CLI", about = "A simple CLI to manipulate a milli index.")]
|
#[structopt(name = "Milli CLI", about = "A simple CLI to manipulate a milli index.")]
|
||||||
struct Cli {
|
struct Cli {
|
||||||
#[structopt(short, long)]
|
#[structopt(short, long, default_value = ".")]
|
||||||
index_path: PathBuf,
|
index_path: PathBuf,
|
||||||
#[structopt(short = "s", long, default_value = "100GiB")]
|
#[structopt(short = "s", long, default_value = "100GiB")]
|
||||||
index_size: Byte,
|
index_size: Byte,
|
||||||
@ -211,6 +211,8 @@ impl Performer for DocumentAddition {
|
|||||||
|
|
||||||
println!("parsing documents...");
|
println!("parsing documents...");
|
||||||
|
|
||||||
|
let reader = BufReader::new(reader);
|
||||||
|
|
||||||
let documents = match self.format {
|
let documents = match self.format {
|
||||||
DocumentAdditionFormat::Csv => documents_from_csv(reader)?,
|
DocumentAdditionFormat::Csv => documents_from_csv(reader)?,
|
||||||
DocumentAdditionFormat::Json => documents_from_json(reader)?,
|
DocumentAdditionFormat::Json => documents_from_json(reader)?,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user