mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Add is_finite_pagination method to SearchQuery
This commit is contained in:
parent
68c9751d49
commit
f4021273b8
2 changed files with 8 additions and 3 deletions
|
@ -428,7 +428,7 @@ impl SearchAggregator {
|
|||
ret.max_terms_number = q.split_whitespace().count();
|
||||
}
|
||||
|
||||
if query.hits_per_page.or(query.page).is_some() {
|
||||
if query.is_finite_pagination() {
|
||||
let limit = query.hits_per_page.unwrap_or_else(DEFAULT_SEARCH_LIMIT);
|
||||
ret.max_limit = limit;
|
||||
ret.max_offset = query.page.unwrap_or(1).saturating_sub(1) * limit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue