Note: SearchWP’s Index was designed in such a way that all operations are handled internally without outside intervention.

Use of this class should be avoided unless directly guided by Support.

Table of Contents

\SearchWP\Index\Controller performs direct operations on the search Index. It is also responsible for maintaining delta update operations.


There are no arguments when instantiating a new \SearchWP\Index\Controller.


There are no public properties in \SearchWP\Index\Controller.


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

reset( $all_sites = false )
Reset the Index by dropping all queues and data.
$all_sites Whether to reset all sites. (default: false only current site)
Getter for Index alias to use in SQL queries.
Getter for Index tables.
Getter for all registered \SearchWP\Sources.
Getter for default \SearchWP\Sources.
get_source_by_name( string $name )
Getter for registered \SearchWP\Source.
$name Source name. (required)
get_entry_status( Entry $entry )
Getter for \SearchWP\Entry status.
$entry Entry to check.
get_source_id_status( string $source, $id )
Getter for \SearchWP\Source status by ID.
$source Source name.
$id Source entry ID (required).
Trigger the delta update process.
add ( Entry $entry )
Add an \SearchWP\Entry to the Index.
drop( Source $source, $id, $force = false )
Drops an \SearchWP\Entry from the Index.
$source Source.
$id ID of the Entry to drop.
$force Whether to drop immediately as opposed to allowing the background process to perform the task.
Retrieve the stats for the Index right now.
get_tokens_for_entry( Entry $entry )
Retrieve the tokens for a single \SearchWP\Entry.


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