Skip to content

Conversation

bidoubiwa
Copy link
Contributor

See spec

Enhancement

It is now possible to delete your tasks:

example:

    let mut query = tasks::TasksDeleteQuery::new(&client);
    query.with_index_uids(["movies"]);
    
    let res = client.delete_tasks_with(&query).await.unwrap();

This will remove all tasks on the index uid movies

TODO

  • Create TaskDeletion detail
  • Create TasksDeleteFilters structure
  • Create TasksDeleteQuery structure
  • Create implementation of TasksQuery with TasksDeleteFilters
  • Add tests

@bidoubiwa bidoubiwa marked this pull request as ready for review November 15, 2022 20:29
@bidoubiwa bidoubiwa added the enhancement New feature or request label Nov 15, 2022
Copy link
Contributor

@alallema alallema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🍗

bidoubiwa and others added 2 commits November 17, 2022 13:41
* Add swap indexes for v0.30.0

* Implement swap indexes

* Add indexSwap detail

* Use tuples as type for the indexes field

* Add tests on index swap

* Create better documentation for indexes swap

* Fix clippy errors

* Fix missing bracket

* Fix swap doc test

* Make doc more clear
@bidoubiwa bidoubiwa merged commit 54ffa60 into bump-meilisearch-v0.30.0-add-cancel-task Nov 17, 2022
@bidoubiwa bidoubiwa deleted the bump-meilisearch-v0.30.0-add-delete-tasks branch November 17, 2022 12:53
bidoubiwa added a commit that referenced this pull request Nov 17, 2022
* Update README.md

* Update README.tpl

* Add filters in tasksQuery

* Add new error codes

* Add builder methods and tests

* Fix clippy suggestions

* Update src/tasks.rs

Co-authored-by: Amélie <[email protected]>

* Implement default taskQuery structure

* Fix flacky tests

* Fix get_tasks test

* Refactor filtering of tasks

* Rename index_uids and task types

* Rename uid, status and types filters to plural

* Add new error codes

* Update error code to plural form

* Update code samples

* Update code-samples with new filter plural naming

* Rename filters to plural form

* Implement cancel_tasks

* Add taskCancelation task details

* Fix execution of get_tasks

* Add canceled by as a return from task

* Fix taskCancelation detail

* Fix typing error

* Chage type of canceled_by

* Make variable plural

* Rollback unrelated changes

* Change variable to plural form

* Add delete tasks for v0.30.0 (#381)

* Add delete tasks for v0.30.0

* Add swap indexes for v0.30.0 (#382)

* Add swap indexes for v0.30.0

* Implement swap indexes

* Add indexSwap detail

* Use tuples as type for the indexes field

* Add tests on index swap

* Create better documentation for indexes swap

* Fix clippy errors

* Fix missing bracket

* Fix swap doc test

* Make doc more clear

Co-authored-by: meili-bot <[email protected]>
Co-authored-by: Amélie <[email protected]>
bors bot added a commit that referenced this pull request Nov 28, 2022
399: Update version for the next release (v0.21.0) r=bidoubiwa a=bidoubiwa

This version makes this package compatible with Meilisearch v0.30.0 🎉
Check out the changelog of [Meilisearch v0.30.0](https://github.com/meilisearch/meilisearch/releases/tag/v0.30.0) for more information on the changes.

## 🚀 Enhancements

- New `pagination` strategy with the search parameters`page` and `hitsPerPage` #374
- New bulder methods on `get_tasks`: `with_uids`, `with_before_enqueued_at`, ... see #375
- New `client.cancel_tasks` method that lets you cancel `enqueued` and `processing` tasks #377 
- New `client.delete_tasks` method that lets you delete tasks #381 
- New `client.swap_indexes` method that lets you swap two indexes #382

## ⚠️ Breaking change

- builder functions on `TasksQuery` name changes: #375
   - `with_status` -> `with_statuses`
   - `with_index_uid` -> `with_index_uids`
   - `with_type` -> `with_types`
- Task detail `receivedDocumentIds` renamed to `providedIds` #393
- Error field in `Task` is now always present and has a `None` value when there are no errors #390
- Add and rename some error codes: #384 

Co-authored-by: Charlotte Vermandel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants