-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Reject paginated search request exceeds rescore window #75556
Conversation
Pinging @elastic/es-search (Team:Search) |
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.
I left one comment. I understand the problem but I wonder if this is more a documentation issue. The window size must not change when paginating so we could add a warning regarding consistent pagination ?
@@ -301,6 +302,24 @@ public ActionRequestValidationException validate() { | |||
if (source.aggregations() != null) { | |||
validationException = source.aggregations().validate(validationException); | |||
} | |||
if (source.rescores() != null) { | |||
if (source.from() > 0) { |
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.
We should also check for the case where from is 0 but the window size is smaller than size alone ?
Changing the window size when paginating is also inconsistent so the window size should be thought with this limitation in mind. The initial window size must be greater or equals than the max allowed from+size to avoid pagination issues so I fear that this change will lead to more inconsistency (users that changed their window size on each request while paginating) ?
Hi @dnhatn, I've created a changelog YAML for you. Note that since this PR is labelled |
@dnhatn shall we close this? |
I am closing this PR as we will update the documentation instead. |
A search request with a positive
from
and the sum offrom
andsize
that exceeds the window size of rescorers can return inconsistent results. I think we should reject such a request.Closes #75363