mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
ff192bb480
3889: Display the total number of tasks matching a filter/query r=dureuill a=Kerollmops This PR returns a new field on the `/tasks` routes. The `total` field exposes the total number of tasks that matches the given filter/query. It is useful to display information on a user interface and can help understand when progress is made in processing tasks, i.e., the total number of tasks on `/tasks?statuses=succeeded` will increase over time. Fixes #3888. - [ ] Update the specs fo the `/tasks` route. ## How have I implemented it? I found it much easier to run two times the task filtering system. Once with the original `from` and `limit` parameters and a second time without. The second call will return the total number of tasks that match the query, not only the number of tasks on the current page. So far, in terms of performance, there doesn't seem to be any issue. I tried different filters with something like 250k tasks. Note that there is a limit of 1M tasks in the queue. Co-authored-by: Clément Renault <clement@meilisearch.com> |
||
---|---|---|
.. | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |