\SearchWP\Indexer facilitates the indexing process of SearchWP. SearchWP’s indexer works alongside hooks set up in \SearchWP\Sources to automatically keep the search Index up to date.

Basic Usage

If you are working with site customizations that do not align with the delta update hooks set up in \SearchWP\Sources you may want to force an Index update. This can be done like so:

// @link
// Forcefully trigger SearchWP's Indexer.
$indexer = new \SearchWP\Indexer();
view raw functions.php hosted with ❤ by GitHub

When the \SearchWP\Indexer is triggered, any necessary delta updates will be queued and applied as though they were triggered by native hooks.


There are no arguments when instantiating a new \SearchWP\Indexer.


There are no public properties in \SearchWP\Indexer.


When working with \SearchWP\Indexer there are a number of methods to consider.

Pause the indexing process.
Unpause the indexing process.


There are a number of hooks available to further modify the behavior of \SearchWP\Indexer: