CANTINA-1000: Prevent impact of filtered formatted ES args when wp vip-search health validate-counts
runs
#5058
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Since
wp vip-search health validate-counts
ultimately calls$indexable->format_args()
which applies theep_formatted_args
filter, it can return the incorrect results for counting ES entities if it's filtered improperly.Example #1:
There's no ES
test
parameter, so this breaks the ES query and results in the below when we runwp vip-search health validate-counts
:Example #2:
Since we're using a high minimum scoring of
3
and there may be no documents are scoring above3
with the way ES uses the TF/IDF scoring model, it returns 0 results, which is not what we want if we just want to validate the general ES document counts. This would be the result when we runwp vip-search health validate-counts
:Changelog Description
Plugin Updated: Enterprise Search
Prevent impact of filtered formatted ES args when
wp vip-search health validate-counts
runsPre-review checklist
Please make sure the items below have been covered before requesting a review:
Pre-deploy checklist
Steps to Test
wp vip-search health validate-counts