mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-28 01:01:00 +00:00
Add the pagination_limited_to setting to the database
This commit is contained in:
@ -258,12 +258,12 @@ impl<'a, 't, 'u, 'i> Settings<'a, 't, 'u, 'i> {
|
||||
self.max_values_per_facet = Setting::Reset;
|
||||
}
|
||||
|
||||
pub fn set_limit_pagination_to(&mut self, value: usize) {
|
||||
self.limit_pagination_to = Setting::Set(value);
|
||||
pub fn set_pagination_limited_to(&mut self, value: usize) {
|
||||
self.pagination_limited_to = Setting::Set(value);
|
||||
}
|
||||
|
||||
pub fn reset_limit_pagination_to(&mut self) {
|
||||
self.limit_pagination_to = Setting::Reset;
|
||||
pub fn reset_pagination_limited_to(&mut self) {
|
||||
self.pagination_limited_to = Setting::Reset;
|
||||
}
|
||||
|
||||
fn reindex<F>(&mut self, cb: &F, old_fields_ids_map: FieldsIdsMap) -> Result<()>
|
||||
@ -646,6 +646,20 @@ impl<'a, 't, 'u, 'i> Settings<'a, 't, 'u, 'i> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn update_pagination_limited_to(&mut self) -> Result<()> {
|
||||
match self.pagination_limited_to {
|
||||
Setting::Set(max) => {
|
||||
self.index.put_pagination_limited_to(&mut self.wtxn, max)?;
|
||||
}
|
||||
Setting::Reset => {
|
||||
self.index.delete_pagination_limited_to(&mut self.wtxn)?;
|
||||
}
|
||||
Setting::NotSet => (),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn execute<F>(mut self, progress_callback: F) -> Result<()>
|
||||
where
|
||||
F: Fn(UpdateIndexingStep) + Sync,
|
||||
|
Reference in New Issue
Block a user