mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Put the documents MTBL back into LMDB
We makes sure to write the documents into a file before memory mapping it and putting it into LMDB, this way we avoid moving it to RAM
This commit is contained in:
parent
d784d87880
commit
0a44ff86ab
10 changed files with 100 additions and 110 deletions
|
@ -49,7 +49,7 @@ fn main() -> anyhow::Result<()> {
|
|||
.open(&opt.database)?;
|
||||
|
||||
// Open the LMDB database.
|
||||
let index = Index::new(&env, opt.database)?;
|
||||
let index = Index::new(&env)?;
|
||||
let rtxn = env.read_txn()?;
|
||||
|
||||
let stdin = io::stdin();
|
||||
|
@ -68,7 +68,7 @@ fn main() -> anyhow::Result<()> {
|
|||
Some(headers) => headers,
|
||||
None => return Ok(()),
|
||||
};
|
||||
let documents = index.documents(result.documents_ids.iter().cloned())?;
|
||||
let documents = index.documents(&rtxn, result.documents_ids.iter().cloned())?;
|
||||
|
||||
let mut stdout = io::stdout();
|
||||
stdout.write_all(&headers)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue