-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Correct XCombinedFieldQuery equals and hashCode #75402
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
Conversation
Previously the equals and hashCode methods only compared the query terms. This meant that queries on different fields, or with different field weights, were considered equal. During boolean query rewrites, duplicate clauses are removed. So because equals/ hashCode was incorrect, rewrites could accidentally drop combined_fields query clauses.
Corresponding Lucene issue: https://issues.apache.org/jira/browse/LUCENE-10026. I copied over the fix that we merged in Lucene. |
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.
LGTM.
Out of interest: I saw the corresponding fix went into Lucene 8.10 so far, any plans on backportign those to 8.9 or not? Only asking since eventually we'll want to remove our version of the query and it would be good to know which Lucene version is equivalent to the current state.
@cbuescher Lucene 8.9.0 was actually already released, and I don't think it's common to do patch releases. If 8.9.1 does end up being planned, I will make sure to backport it. |
Previously the equals and hashCode methods only compared the query terms. This meant that queries on different fields, or with different field weights, were considered equal. During boolean query rewrites, duplicate clauses are removed. So because equals/ hashCode was incorrect, rewrites could accidentally drop combined_fields query clauses.
Previously the equals and hashCode methods only compared the query terms. This meant that queries on different fields, or with different field weights, were considered equal. During boolean query rewrites, duplicate clauses are removed. So because equals/ hashCode was incorrect, rewrites could accidentally drop combined_fields query clauses.
Previously the equals and hashCode methods only compared the query terms. This meant that queries on different fields, or with different field weights, were considered equal. During boolean query rewrites, duplicate clauses are removed. So because equals/ hashCode was incorrect, rewrites could accidentally drop combined_fields query clauses.
Previously the equals and hashCode methods only compared the query terms. This
meant that queries on different fields, or with different field weights, were
considered equal.
During boolean query rewrites, duplicate clauses are removed. So because equals/
hashCode was incorrect, rewrites could accidentally drop combined_fields query
clauses.
Fixes #75223.