-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Hard limit the number of results returned by a search #2281
Conversation
I don't think that this is how it should be done. what if I ask for 1 document at offset 10000? I think we need to pass the following params to milli:
wdyt? |
Ahha yeah, I'm dumb, you are absolutely right. That's probably due to jet lag. I will update my PR accordingly. Thanks! |
@Kerollmops, for testability, you could in fact do a mock here, but maybe the simple option would be to make a function like If we wanted to make integration tests, having a way to lower the value of |
I don't think that we need to move this simple logic in another function, it is not used in any other place.
I just added two integration tests that check that a placeholder or normal search is limited and even changing the offset to a big number doesn't expose documents past our hard 1000 limit. Thank you for that by the way 😂 |
fac7405
to
ffafd5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for me ✅
Wait for the final Marin's approval for the merge
Thank you for the reviews, merging now! |
This PR fixes #2133 by hard-limiting the number of results that a search request can return at any time. I would like the guidance of @MarinPostma to test that, should I use a mocking test here? Or should I do anything else?
I talked about touching the nb_hits value with @qdequele and we concluded that it was not correct to do so.
Could you please confirm that it is the right place to change that?