Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update task api for v0.28.0 #299

Merged
merged 24 commits into from
Aug 22, 2022

Conversation

bidoubiwa
Copy link
Contributor

@bidoubiwa bidoubiwa commented Jul 11, 2022

Pull Request

Related to: meilisearch/integration-guides#205

Breaking

  • Actions that create a task in Meilisearch now return a TaskInfo and not a Task object anymore. (ex: add_documents).
  • get_tasks now returns a TasksResults where the tasks are contained inside the results field.
  • task_id in Task andTaskInfo is now a u32 instead of a u64
  • index_uid in Task and TaskInfo is now an Optionnal.
  • TaskType documentAddition is replaced with DocumentAdditionOrUpdate
  • Add pagination to get_tasks based of this using limit, from, next metadata in the response.
  • Rename these task types:
    • documentPartial -> documentAdditionOrUpdate
    • documentAddition -> documentAdditionOrUpdate
    • clearAll -> documentDeletion
  • Possibility to filter the tasks when using get_tasks on indexUid, status and type.

// 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

  • index.get_task & index.wait_for_task now use GET /tasks/:task_uid

@bidoubiwa bidoubiwa changed the base branch from main to bump-meilisearch-v0.28.0 July 11, 2022 11:15
@bidoubiwa bidoubiwa force-pushed the update_task_api_for_v0.28.0 branch from fd3d171 to d21ac0e Compare August 3, 2022 12:27
@bidoubiwa bidoubiwa force-pushed the update_task_api_for_v0.28.0 branch from d21ac0e to 61be5a5 Compare August 3, 2022 12:28
@bidoubiwa bidoubiwa force-pushed the bump-meilisearch-v0.28.0 branch from 704f22e to f46f78d Compare August 3, 2022 12:30
@bidoubiwa bidoubiwa marked this pull request as ready for review August 3, 2022 14:28
@bidoubiwa bidoubiwa added the breaking-change The related changes are breaking for the users label Aug 3, 2022
@bidoubiwa bidoubiwa requested review from alallema and removed request for brunoocasali August 3, 2022 15:03
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.

Well done !!! 🔥

src/indexes.rs Outdated Show resolved Hide resolved
src/client.rs Show resolved Hide resolved
src/utils.rs Show resolved Hide resolved
@bidoubiwa bidoubiwa requested a review from alallema August 4, 2022 15:10
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.

I put a comment I don't understand what is done

src/indexes.rs Outdated Show resolved Hide resolved
src/utils.rs Show resolved Hide resolved
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.

Amazing !!! LGTM!

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.

Well Done! 🎉
LGTM ✨

@bidoubiwa bidoubiwa requested a review from alallema August 9, 2022 13:11
src/client.rs Outdated Show resolved Hide resolved
src/client.rs Outdated Show resolved Hide resolved
src/client.rs Outdated Show resolved Hide resolved
src/search.rs Outdated Show resolved Hide resolved
src/tasks.rs Outdated Show resolved Hide resolved
src/tasks.rs Outdated Show resolved Hide resolved
@bidoubiwa bidoubiwa requested a review from irevoire August 10, 2022 15:14
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.

🔥 🔥 🔥

@bidoubiwa bidoubiwa merged commit 0351c8a into bump-meilisearch-v0.28.0 Aug 22, 2022
@bidoubiwa bidoubiwa deleted the update_task_api_for_v0.28.0 branch August 22, 2022 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change The related changes are breaking for the users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants