SearchWP

This Documentation is for SearchWP Version 3

Available since: 1.3

searchwp_max_index_attempts

View Parameters »

SearchWP’s indexer runs on a system of chunks and passes. The indexer breaks up site content into manageable passes of content, each pass parsing a certain number of posts for indexing. This is to avoid breaching server limits (e.g. PHP timeouts, running out of RAM). SearchWP also tries to avoid triggering resource breaches on a per-post basis by ‘chunking’ large entries into smaller bits and indexing one chunk at a time per indexer pass.

There are times, however, where an entry may fail indexing for one reason or another. The most common reason a post will fail to index is because it’s a PDF that is too large for SearchWP’s PDF parser to properly handle without breaching the server’s limits.

When an entry fails to be indexed, SearchWP will try to index it again in case it was some strange edge case that prevented indexing the first time. It will try to index the problematic entry by default three times before flagging it as something that should be skipped over, and you will be shown a notice in the WordPress admin.

If you would like to modify how many times SearchWP attempts to index an entry you can use this hook by adding something like the following to your theme’s functions.php:

<?php
function my_searchwp_max_index_attempts( $number_of_attempts ) {
return 1; // only retry one time
}
add_filter( 'searchwp_max_index_attempts', 'my_searchwp_max_index_attempts' );
view raw gistfile1.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$number_of_attempts Integer

How many times the indexer should try to index an entry

[wpforms id="3080"]