mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
Add a totalHits field on finite pagination return
This commit is contained in:
parent
0fa5c9b515
commit
e9d493c052
@ -118,6 +118,7 @@ pub enum HitsInfo {
|
||||
hits_per_page: usize,
|
||||
page: usize,
|
||||
total_pages: usize,
|
||||
total_hits: usize,
|
||||
},
|
||||
#[serde(rename_all = "camelCase")]
|
||||
OffsetLimit {
|
||||
@ -299,8 +300,8 @@ impl Index {
|
||||
HitsInfo::Pagination {
|
||||
hits_per_page,
|
||||
page: offset / hits_per_page + 1,
|
||||
// TODO @many: estimation for now but we should ask milli to return an exact value
|
||||
total_pages: (number_of_hits + hits_per_page - 1) / query.hits_per_page,
|
||||
total_hits: number_of_hits,
|
||||
}
|
||||
} else {
|
||||
HitsInfo::OffsetLimit {
|
||||
|
Loading…
Reference in New Issue
Block a user