refresh
This commit is contained in:
@@ -23,9 +23,9 @@ pub struct LookupCommand {
|
|||||||
#[arg(long, short = 'c', default_value = "./pile.toml")]
|
#[arg(long, short = 'c', default_value = "./pile.toml")]
|
||||||
config: PathBuf,
|
config: PathBuf,
|
||||||
|
|
||||||
/// If provided, do not refresh fts
|
/// If provided, refresh fts if it is out-of-date
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
no_refresh: bool,
|
refresh: bool,
|
||||||
|
|
||||||
/// Number of threads to use for indexing
|
/// Number of threads to use for indexing
|
||||||
#[arg(long, short = 'j', default_value = "3")]
|
#[arg(long, short = 'j', default_value = "3")]
|
||||||
@@ -42,7 +42,7 @@ impl CliCmd for LookupCommand {
|
|||||||
let ds = Dataset::open(&self.config)
|
let ds = Dataset::open(&self.config)
|
||||||
.with_context(|| format!("while opening dataset for {}", self.config.display()))?;
|
.with_context(|| format!("while opening dataset for {}", self.config.display()))?;
|
||||||
|
|
||||||
if !self.no_refresh {
|
if self.refresh {
|
||||||
if ds.needs_fts().context("while checking dataset fts")? {
|
if ds.needs_fts().context("while checking dataset fts")? {
|
||||||
info!("FTS index is missing or out-of-date, regenerating");
|
info!("FTS index is missing or out-of-date, regenerating");
|
||||||
ds.fts_refresh(self.jobs, Some(flag)).map_err(|x| {
|
ds.fts_refresh(self.jobs, Some(flag)).map_err(|x| {
|
||||||
|
|||||||
Reference in New Issue
Block a user