mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Introduce a function to get all updates results
This commit is contained in:
parent
9602d7a960
commit
8a17fcdda5
3 changed files with 46 additions and 4 deletions
|
@ -202,6 +202,20 @@ impl Index {
|
|||
update::update_status(reader, self.updates, self.updates_results, update_id)
|
||||
}
|
||||
|
||||
pub fn all_updates_status(&self, reader: &heed::RoTxn) -> MResult<Vec<update::UpdateStatus>> {
|
||||
match self.updates_results.last_update_id(reader)? {
|
||||
Some((last_id, _)) => {
|
||||
let mut updates = Vec::with_capacity(last_id as usize + 1);
|
||||
for id in 0..=last_id {
|
||||
let update = self.update_status(reader, id)?;
|
||||
updates.push(update);
|
||||
}
|
||||
Ok(updates)
|
||||
}
|
||||
None => Ok(Vec::new()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn query_builder(&self) -> QueryBuilder {
|
||||
QueryBuilder::new(
|
||||
self.main,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue