-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Apply boolean must_not rewrite to numeric match, term, and terms queries #18498
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
base: main
Are you sure you want to change the base?
Apply boolean must_not rewrite to numeric match, term, and terms queries #18498
Conversation
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
❌ Gradle check result for 9a036fa: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
❌ Gradle check result for 841d01b: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Peter Alfonsi <[email protected]>
❌ Gradle check result for d1200d6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Peter Alfonsi <[email protected]>
❌ Gradle check result for 9712c7b: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Flaky test: #14509 |
Signed-off-by: Peter Alfonsi <[email protected]>
❌ Gradle check result for 4d9faab: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Peter Alfonsi <[email protected]>
Signed-off-by: Peter Alfonsi <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #18498 +/- ##
============================================
+ Coverage 72.68% 72.81% +0.12%
- Complexity 68130 68198 +68
============================================
Files 5540 5541 +1
Lines 313379 313440 +61
Branches 45472 45484 +12
============================================
+ Hits 227785 228229 +444
+ Misses 67070 66647 -423
- Partials 18524 18564 +40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Followup to #17655, where we rewrote range queries in boolean must_not clauses to instead be should clauses containing the complement of the original query. This PR extends the rewrite to match, term, and terms queries on numeric fields.
The speedups here seem larger than for range queries, plus I imagine must_not of numeric terms might be more common than on ranges. (Imagine excluding all documents with HTTP status 200 for example). So hopefully this PR will be more useful than the first one.
Some benchmark numbers from http_logs are below. These were run on 1-node clusters using tar installs in c5.2xl ec2 instances. "Originally written as" means whether the query was sent to OpenSearch with a must_not clause, and if so, whether it was a match or term query, or if the query was sent already rewritten with should clauses. Ideally, after the changes are applied, these p50s should be the same, because the
must_not
s are internally rewritten to beshould
ofrange
s. Note 200 is the most common value, and 404 and 500 are rarer.must_not
ofmatch
must_not
ofterm
should
ofrange
smust_not
ofmatch
must_not
ofterm
should
ofrange
smust_not
ofmatch
must_not
ofterm
should
ofrange
smust_not
ofterms
should
ofrange
smust_not
ofterms
should
ofrange
sRelated Issues
Part of #17586
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.