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

Reject paginated search request exceeds rescore window #75556

Closed
wants to merge 5 commits into from

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Jul 21, 2021

A search request with a positive from and the sum of from and size that exceeds the window size of rescorers can return inconsistent results. I think we should reject such a request.

Closes #75363

@dnhatn dnhatn added >bug :Search/Search Search-related issues that do not fall into other categories labels Jul 21, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jul 21, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@dnhatn dnhatn added v7.15.0 >breaking and removed Team:Search Meta label for search team labels Jul 21, 2021
@dnhatn dnhatn requested a review from jimczi July 21, 2021 02:23
@dnhatn dnhatn changed the title Reject search request exceeds rescore window Reject paginated search request exceeds rescore window Jul 21, 2021
Copy link
Contributor

@jimczi jimczi left a 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) {
Copy link
Contributor

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) ?

@elasticsearchmachine
Copy link
Collaborator

Hi @dnhatn, I've created a changelog YAML for you. Note that since this PR is labelled >breaking, you need to update the changelog YAML to fill out the extended information sections.

@javanna
Copy link
Member

javanna commented Feb 9, 2022

@dnhatn shall we close this?

@dnhatn
Copy link
Member Author

dnhatn commented Feb 9, 2022

I am closing this PR as we will update the documentation instead.

@dnhatn dnhatn closed this Feb 9, 2022
@dnhatn dnhatn deleted the rescore-window branch February 9, 2022 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking >bug :Search/Search Search-related issues that do not fall into other categories v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rescorer does wrong reorder for tanked hits
8 participants