mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Move the heed env into the index itself to ease the usage of the library
This commit is contained in:
parent
b5d52b6b45
commit
e63fdf2b22
6 changed files with 42 additions and 34 deletions
|
@ -40,14 +40,12 @@ pub fn run(opt: Opt) -> anyhow::Result<()> {
|
|||
.init()?;
|
||||
|
||||
std::fs::create_dir_all(&opt.database)?;
|
||||
let env = EnvOpenOptions::new()
|
||||
.map_size(opt.database_size)
|
||||
.max_dbs(10)
|
||||
.open(&opt.database)?;
|
||||
let mut options = EnvOpenOptions::new();
|
||||
options.map_size(opt.database_size);
|
||||
|
||||
// Open the LMDB database.
|
||||
let index = Index::new(&env)?;
|
||||
let rtxn = env.read_txn()?;
|
||||
let index = Index::new(options, &opt.database)?;
|
||||
let rtxn = index.read_txn()?;
|
||||
|
||||
let stdin = io::stdin();
|
||||
let lines = match opt.query {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue