meilisearch-rust
meilisearch-rust copied to clipboard
Update task api for v0.28.0
Pull Request
Related to: https://github.com/meilisearch/integration-guides/issues/205
Breaking
- [x] Actions that create a task in Meilisearch now return a
TaskInfoand not aTaskobject anymore. (ex: add_documents). - [x]
get_tasksnow returns aTasksResultswhere the tasks are contained inside theresultsfield. - [x]
task_idinTaskandTaskInfois now au32instead of au64 - [x]
index_uidinTaskandTaskInfois now an Optionnal. - [x] TaskType
documentAdditionis replaced withDocumentAdditionOrUpdate - [x] Add pagination to
get_tasksbased of this usinglimit,from,nextmetadata in the response. - [x] Rename these task types:
- documentPartial -> documentAdditionOrUpdate
- documentAddition -> documentAdditionOrUpdate
- clearAll -> documentDeletion
- [x] Possibility to filter the tasks when using
get_tasksonindexUid,statusandtype.
// get_tasks
let tasks = client.get_tasks().await.unwrap()
// get_tasks_with
let mut query = tasks::TasksQuery::new(&client);
query.with_index_uid(["get_tasks_with"]);
let tasks = client.get_tasks_with(&query).await.unwrap();
// get tasks using execute
let mut query = tasks::TasksQuery::new(&client)
.with_index_uid(["get_tasks_with"])
.execute()
.await
.unwrap();
Routes changes
- [x]
index.get_task&index.wait_for_tasknow useGET /tasks/:task_uid