mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
get update id
This commit is contained in:
parent
4119ae8655
commit
60371b9dcf
4 changed files with 47 additions and 38 deletions
|
@ -8,6 +8,7 @@ use std::path::Path;
|
|||
use std::sync::Arc;
|
||||
|
||||
use milli::Index;
|
||||
use anyhow::bail;
|
||||
|
||||
use crate::option::IndexerOpts;
|
||||
use super::IndexController;
|
||||
|
@ -73,4 +74,11 @@ impl IndexController for LocalIndexController {
|
|||
let index = self.indexes.index(name)?.map(|(i, _)| i);
|
||||
Ok(index)
|
||||
}
|
||||
|
||||
fn update_status(&self, index: impl AsRef<str>, id: u64) -> anyhow::Result<Option<UpdateStatus<UpdateMeta, UpdateResult, String>>> {
|
||||
match self.indexes.index(&index)? {
|
||||
Some((_, update_store)) => Ok(update_store.meta(id)?),
|
||||
None => bail!("index {:?} doesn't exist", index.as_ref()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,4 +135,6 @@ pub trait IndexController {
|
|||
|
||||
/// Returns, if it exists, an `IndexView` to the requested index.
|
||||
fn index(&self, uid: impl AsRef<str>) -> anyhow::Result<Option<Arc<Index>>>;
|
||||
|
||||
fn update_status(&self, index: impl AsRef<str>, id: u64) -> anyhow::Result<Option<UpdateStatus<UpdateMeta, UpdateResult, String>>>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue