Skip to content

Add support to the pagination setting customization at the index level #342

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

Merged
merged 15 commits into from
Oct 10, 2022

Conversation

vishalsodani
Copy link
Contributor

Pull Request

What does this PR do?

Fixes #304

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@bidoubiwa
Copy link
Contributor

Hello @vishalsodani,
Thank you very much for contributing to Meilisearch ❤️.
However, I am not available on the weekend, but I will be back on Monday 😊.

PS: This message was sent automatically!

Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution 🔥

@curquiza curquiza requested a review from bidoubiwa October 3, 2022 13:12
@bidoubiwa
Copy link
Contributor

Please go over your code again to ensure that you updated the types everywhere.

@vishalsodani
Copy link
Contributor Author

Please go over your code again to ensure that you updated the types everywhere.

Thanks! Sure.

@vishalsodani
Copy link
Contributor Author

Please go over your code again to ensure that you updated the types everywhere.

Should I add PaginationSetting to Settings struct as a member?

@bidoubiwa
Copy link
Contributor

Absolutely!

@bidoubiwa
Copy link
Contributor

bidoubiwa commented Oct 4, 2022

Could you add tests at the bottom of the file? I do realize that there are no previous tests made, but we should start making them

@vishalsodani
Copy link
Contributor Author

Could you add tests at the bottom of the file? I do realize that there are no previous tests made, but we should start making them

What tests? Are you asking to write some specific kind of tests?

Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

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

At the bottom of the settings.rs you can start adding tests the following way:

#[cfg(test)]
mod tests {
    use super::*;

    use crate::client::*;
    use meilisearch_test_macro::meilisearch_test;

    #[meilisearch_test]
    async fn test_get_pagination(index: Index) {
        let res = index.get_pagination().await.unwrap();
        let pagination = PaginationSetting {
            max_total_hits: 1000,
        };

        assert_eq!(pagination, res);
    }
}

Could you also make one for update and reset?

Copy link
Contributor

@bidoubiwa bidoubiwa left a comment

Choose a reason for hiding this comment

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

Some styling changes

@bidoubiwa bidoubiwa requested a review from irevoire October 4, 2022 15:25
@bidoubiwa bidoubiwa mentioned this pull request Oct 4, 2022
3 tasks
@vishalsodani
Copy link
Contributor Author

At the bottom of the settings.rs you can start adding tests the following way:

#[cfg(test)]
mod tests {
    use super::*;

    use crate::client::*;
    use meilisearch_test_macro::meilisearch_test;

    #[meilisearch_test]
    async fn test_get_pagination(index: Index) {
        let res = index.get_pagination().await.unwrap();
        let pagination = PaginationSetting {
            max_total_hits: 1000,
        };

        assert_eq!(pagination, res);
    }
}

Could you also make one for update and reset?

Done.

@bidoubiwa bidoubiwa marked this pull request as draft October 6, 2022 11:00
@bidoubiwa
Copy link
Contributor

Are you still working on this @vishalsodani?

@vishalsodani
Copy link
Contributor Author

Are you still working on this @vishalsodani?

Yes, of course. Are there any issues left to be fixed?

@bidoubiwa
Copy link
Contributor

Yes unfortunately there is a conflict, could you resolve it?

@bidoubiwa bidoubiwa marked this pull request as ready for review October 6, 2022 14:11
@vishalsodani
Copy link
Contributor Author

Yes unfortunately there is a conflict, could you resolve it?

resolved.

@bidoubiwa
Copy link
Contributor

Your clippy checks are failing, could you resolve them?

@vishalsodani
Copy link
Contributor Author

Your clippy checks are failing, could you resolve them?

Any idea about this issue?

https://github.com/meilisearch/meilisearch-rust/actions/runs/3198029601/jobs/5222032915#step:4:184

error: large size difference between variants

@bidoubiwa
Copy link
Contributor

@irevoire any idea about this? Is boxing the good response to this issue?

@bidoubiwa
Copy link
Contributor

I checked with him and it's good :) It should even improve the performances

Copy link
Contributor

@bidoubiwa bidoubiwa 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
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Oct 10, 2022

Build succeeded:

@bors bors bot merged commit 78c5474 into meilisearch:main Oct 10, 2022
@bidoubiwa
Copy link
Contributor

This message is sent automatically

Thanks again for contributing to Meilisearch ❤️
If you are participating in Hacktoberfest, and you would like to receive some gift from Meilisearch too, please complete this form.

@bidoubiwa bidoubiwa added the enhancement New feature or request label Oct 10, 2022
@vishalsodani vishalsodani deleted the pagination_setting_index branch October 10, 2022 15:21
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.

Add support to the pagination setting customization at the index level
2 participants