\SearchWP\Index\Controller
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.
Arguments
There are no arguments when instantiating a new \SearchWP\Index\Controller
.
Properties
There are no public properties in \SearchWP\Index\Controller
.
Methods
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)get_alias
- Getter for Index alias to use in SQL queries.
get_tables
- Getter for Index tables.
get_sources
- Getter for all registered
\SearchWP\Source
s. get_default_sources
- Getter for default
\SearchWP\Source
s. 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
- 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.get_stats
- Retrieve the stats for the Index right now.
get_tokens_for_entry( Entry $entry )
- Retrieve the tokens for a single
\SearchWP\Entry
.
Hooks
There are a number of hooks available to further modify the behavior of \SearchWP\Index\Controller
: