This commit is contained in:
Alex Wied
2026-07-02 14:09:54 -04:00
parent 038afc4645
commit b7b52e3c09
6 changed files with 54 additions and 49 deletions
+3
View File
@@ -11,4 +11,7 @@ pub enum SearchError {
#[error(transparent)]
OpenDirectoryError(#[from] tantivy::directory::error::OpenDirectoryError),
#[error(transparent)]
Io(#[from] std::io::Error),
}
+2
View File
@@ -1,3 +1,4 @@
use std::fs;
use crate::{error, update};
use crate::schema::Schema;
use std::path::PathBuf;
@@ -34,6 +35,7 @@ impl SearchIndexBuilder {
.tokenizers(tokenizer_manager);
let index = if let Some(path) = self.path {
fs::create_dir_all(&path)?;
let mmap_directory = MmapDirectory::open(path)?;
let managed_directory = ManagedDirectory::wrap(Box::new(mmap_directory))?;
builder.open_or_create(managed_directory)?