BUG: EP 4.x - Edit Category update times
Describe the bug Experiencing issues updating categories with large number of posts (30k), it takes between 7-27 minutes which on Production causes timeouts
Appears to be triggering a Sync on every Update
Steps to Reproduce
- ElasticPress 4.2.2 (any version 4 release)
- Full Index via WP-CLI
- Edit Category with thousands of posts (30k) and click Update
- See error
Expected behavior Category is expected to update within a reasonable amount of time and not in the realms of hitting timeouts
Screenshots

It seems related to #2924
For users having this problem, the solution outlined in this comment might help:
You can stop ElasticPress from indexing on a taxonomy edit:
add_filter(` 'ep_skip_action_edited_term', '__return_true' );
If you want to make that decision based on the number of posts associated with the term in question, you can use a code like this:
function ep_2933_skip_action_edited_term( $skip, $term_id, $tt_id, $taxonomy, $object_ids ) {
return ( count( $object_ids ) > 100 ) ? true : $skip; // Change 100 to the number you want
}
add_filter( 'ep_skip_action_edited_term', 'ep_2933_skip_action_edited_term', 10, 5 );
Just keep in mind that you will need to manually sync everything once you have made all the changes you need.
Hi @felipeelia is this posed as a workaround solution until a proper fix is implemented?
Hey @cmcandrew, yes. The problem with this one is how we will want to "fix" it. We have a couple of options:
- Make the opposite of how we have it today: totally disable syncs for edited terms, and make it opt-in.
- (The easiest) Only sync when a term with a certain number of posts is edited.
- (The optimal) Only sync that specific field of all posts, potentially sending a much smaller request. For this, we will need to create a mechanism to sync parts of posts.
We will talk about it during our next internal sync and plan accordingly for the next releases.