This Documentation is for SearchWP Version 3

Available since: 1.0


View Parameters »

SearchWP’s indexer tries to run as fast as it can. In some environments (depending on configuration) the indexer may be faced with an issue known as INSERT Deadlock. This means that the database tables are locked when SearchWP is attempting to index a post. SearchWP will attempt to wait out the deadlock by default 5 times, pausing for a second between each attempt. If you would like to adjust how many retries the indexer executes during an INSERT Deadlock, you can use this hook like so:

// only try to recover from INSERT Deadlock 3 times
function my_searchwp_indexer_max_attempts( $number_of_attempts ) {
return 3;
add_filter( 'searchwp_indexer_max_attempts', 'my_searchwp_indexer_max_attempts' );
view raw gistfile1.php hosted with ❤ by GitHub


Parameter Type Description
$number_of_attempts Integer

How many attempts the indexer should make when faced with an INSERT Deadlock