SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater
This class is responsible for capturing changes to DataObjects and triggering index updates of the resulting dirty index items.
Attached automatically by Injector configuration that overloads your flavour of Database class. The
SearchManipulateCapture_[type] classes overload the manipulate method - basically we need to capture a
manipulation _after_ all the augmentManipulation code (for instance Version's) is run
Pretty closely tied to the field structure of SearchIndex.
Synopsis
class SearchUpdater
{
- // members
- private static bool $flush_on_shutdown = true;
- private static bool $enabled = true;
- public static boolean $registered = false;
- public static SearchUpdateProcessor $processor = NULL;
- // methods
- public static void handle_manipulation()
- public static void process_writes()
- public static void clear_dirty_indexes()
- public static void flush_dirty_indexes()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $enabled
—
SilverStripe\FullTextSearch\Search\Updaters\bool
Whether the updater is enabled. Set to false for local development if you don't have a Solr server. - $flush_on_shutdown
—
SilverStripe\FullTextSearch\Search\Updaters\bool
Whether to register the shutdown function to flush. Can be disabled for example in unit testing.
public
- $processor — SilverStripe\FullTextSearch\Search\Processors\SearchUpdateProcessor
- $registered
Methods
public
- clear_dirty_indexes() — Throw away the recorded dirty IDs without doing anything with them.
- flush_dirty_indexes() — Do something with the recorded dirty IDs, where that "something" depends on the value of self::$update_method, either immediately update the indexes, queue a messsage to update the indexes at some point in the future, or just throw the dirty IDs away.
- handle_manipulation() — Called by the ProxyDBExtension database connector with every manipulation made against the database.
- process_writes() — Send updates to the current search processor for execution