-
Notifications
You must be signed in to change notification settings - Fork 102
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
Search: Add filter_ep_enable_do_weighting to reduce ES payload if weighting is not used #3340
Conversation
6764257
to
f4ab087
Compare
Codecov Report
@@ Coverage Diff @@
## develop #3340 +/- ##
=============================================
+ Coverage 33.00% 33.12% +0.12%
- Complexity 3457 3467 +10
=============================================
Files 213 213
Lines 13603 13620 +17
=============================================
+ Hits 4489 4511 +22
+ Misses 9114 9109 -5
Continue to review full report at Codecov.
|
063bc2d
to
f4cc0a7
Compare
f4cc0a7
to
51b34f4
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
A default ES search request appears to be under the assumption that weighting is always being used: https://github.com/Automattic/ElasticPress/blob/2302acc659745e767ea0908eeb44a81f9dab755d/includes/classes/Feature/Search/Weighting.php#L644-L647
However, if weighting is not being used, we can reduce the payload by not recursively creating subqueries and thus, decrease the total ES query time. More information on the query at hand described in 10up/ElasticPress#2512.
This PR adds the filter
filter_ep_enable_do_weighting
, which checks to see if a weighting configuration has been saved or if any of the below filters are hooked onto outside of ElasticPress:Changelog Description
Plugin Updated: Enterprise Search
Search: Add filter_ep_enable_do_weighting to reduce ES payload if weighting is not used
Checklist
Please make sure the items below have been covered before requesting a review:
Steps to Test
?s=hello
and see the below ES query being executed: