Created
April 15, 2014 12:53
-
-
Save jchristopher/10730056 to your computer and use it in GitHub Desktop.
Throttle the SearchWP indexer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// pause the indexer for 1s in between passes | |
function my_searchwp_indexer_throttle() { | |
return 1; | |
} | |
add_filter( 'searchwp_indexer_throttle', 'my_searchwp_indexer_throttle' ); | |
// only process 3 posts per indexer pass (instead of the default of 10) | |
function my_searchwp_index_chunk_size() { | |
return 3; | |
} | |
add_filter( 'searchwp_index_chunk_size', 'my_searchwp_index_chunk_size' ); | |
// only process 200 terms at a time | |
function my_searchwp_process_term_limit() { | |
return 200; | |
} | |
add_filter( 'searchwp_process_term_limit', 'my_searchwp_process_term_limit' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment