Skip to content

Commit

Permalink
CANTINA-1000: Prevent impact of filtered formatted ES args when `wp v…
Browse files Browse the repository at this point in the history
…ip-search health validate-counts` runs (#5058)
  • Loading branch information
rebeccahum authored Nov 30, 2023
1 parent 708003d commit 19b58dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions search/includes/classes/class-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ public function get_index_entity_count_from_elastic_search( array $query_args, \
// Since the user indexable is global, we want to include ALL in count.
unset( $query->query_vars['blog_id'] );
}

// An improperly formatted ES args filter can break the `wp vip-search health validate-counts` CLI.
remove_all_filters( 'ep_formatted_args' );
remove_all_filters( 'ep_post_formatted_args' );

$formatted_args = $indexable->format_args( $query->query_vars, $query );

// Get exact total count since Elasticsearch default stops at 10,000.
Expand Down

0 comments on commit 19b58dd

Please sign in to comment.