interface TrackerInterface in Search API 8
Defines an interface for index tracker plugins.
The tracker of an index is responsible for keeping track of the items indexed in the index, which have changed since they were last indexed, etc.
The tracker is required to ignore calls to tracking methods for item IDs that won't have any effect – that is, inserting items which are already known, or marking items as indexed, updated or deleted that are not.
Hierarchy
- interface \Drupal\search_api\Plugin\HideablePluginInterface; interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\DerivativeInspectionInterface; interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface; interface \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- interface \Drupal\search_api\Plugin\ConfigurablePluginInterface
- interface \Drupal\search_api\Plugin\IndexPluginInterface
- interface \Drupal\search_api\Tracker\TrackerInterface
- interface \Drupal\search_api\Plugin\IndexPluginInterface
- interface \Drupal\search_api\Plugin\ConfigurablePluginInterface
Expanded class hierarchy of TrackerInterface
All classes that implement TrackerInterface
See also
\Drupal\search_api\Annotation\SearchApiTracker
\Drupal\search_api\Tracker\TrackerPluginManager
\Drupal\search_api\Tracker\TrackerPluginBase
3 files declare their use of TrackerInterface
- Index.php in src/
Entity/ Index.php - IndexInterface.php in src/
IndexInterface.php - UnsavedIndexConfiguration.php in src/
UnsavedIndexConfiguration.php
File
- src/
Tracker/ TrackerInterface.php, line 22
Namespace
Drupal\search_api\TrackerView source
interface TrackerInterface extends IndexPluginInterface {
/**
* Inserts new items into the tracking system for this index.
*
* @param string[] $ids
* The item IDs of the new search items.
*/
public function trackItemsInserted(array $ids);
/**
* Marks the given items as updated for this index.
*
* @param string[] $ids
* The item IDs of the updated items.
*/
public function trackItemsUpdated(array $ids);
/**
* Marks all items as updated, or only those of a specific datasource.
*
* @param string|null $datasource_id
* (optional) If given, only items of that datasource are marked as updated.
*/
public function trackAllItemsUpdated($datasource_id = NULL);
/**
* Marks items as indexed for this index.
*
* @param string[] $ids
* An array of item IDs.
*/
public function trackItemsIndexed(array $ids);
/**
* Removes items from the tracking system for this index.
*
* @param string[]|null $ids
* (optional) The item IDs of the deleted items; or NULL to remove all
* items.
*/
public function trackItemsDeleted(array $ids = NULL);
/**
* Removes all items from the tracker, or only those of a specific datasource.
*
* @param string|null $datasource_id
* (optional) If given, only items of that datasource are removed.
*/
public function trackAllItemsDeleted($datasource_id = NULL);
/**
* Retrieves a list of item IDs that need to be indexed.
*
* @param int $limit
* (optional) The maximum number of items to return. Or a negative value to
* return all remaining items.
* @param string|null $datasource_id
* (optional) If specified, only items of the datasource with that ID are
* retrieved.
*
* @return string[]
* The IDs of items that still need to be indexed.
*/
public function getRemainingItems($limit = -1, $datasource_id = NULL);
/**
* Retrieves the total number of items that are being tracked for this index.
*
* @param string|null $datasource_id
* (optional) The datasource to filter the total number of items by.
*
* @return int
* The total number of items that are tracked for this index, or for the
* given datasource on this index.
*/
public function getTotalItemsCount($datasource_id = NULL);
/**
* Retrieves the number of indexed items for this index.
*
* @param string|null $datasource_id
* (optional) The datasource to filter the total number of indexed items by.
*
* @return int
* The number of items that have been indexed in their latest state for this
* index, or for the given datasource on this index.
*/
public function getIndexedItemsCount($datasource_id = NULL);
/**
* Retrieves the total number of pending items for this index.
*
* @param string|null $datasource_id
* (optional) The datasource to filter the total number of pending items by.
*
* @return int
* The total number of items that still need to be indexed for this index,
* or for the given datasource on this index.
*/
public function getRemainingItemsCount($datasource_id = NULL);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
ConfigurablePluginInterface:: |
public | function | Returns the plugin's description. | 1 |
ConfigurablePluginInterface:: |
public | function | Returns the label for use on the administration pages. | 1 |
ConfigurablePluginInterface:: |
public | function | Informs the plugin that some of its dependencies are being removed. | 1 |
ContainerFactoryPluginInterface:: |
public static | function | Creates an instance of the plugin. | 112 |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 19 |
DerivativeInspectionInterface:: |
public | function | Gets the base_plugin_id of the plugin instance. | 1 |
DerivativeInspectionInterface:: |
public | function | Gets the derivative_id of the plugin instance. | 1 |
HideablePluginInterface:: |
public | function | Determines whether this plugin should be hidden in the UI. | 1 |
IndexPluginInterface:: |
public | function | Retrieves the index this plugin is configured for. | 1 |
IndexPluginInterface:: |
public | function | Sets the index this plugin is configured for. | 1 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
TrackerInterface:: |
public | function | Retrieves the number of indexed items for this index. | 2 |
TrackerInterface:: |
public | function | Retrieves a list of item IDs that need to be indexed. | 2 |
TrackerInterface:: |
public | function | Retrieves the total number of pending items for this index. | 2 |
TrackerInterface:: |
public | function | Retrieves the total number of items that are being tracked for this index. | 2 |
TrackerInterface:: |
public | function | Removes all items from the tracker, or only those of a specific datasource. | 2 |
TrackerInterface:: |
public | function | Marks all items as updated, or only those of a specific datasource. | 2 |
TrackerInterface:: |
public | function | Removes items from the tracking system for this index. | 2 |
TrackerInterface:: |
public | function | Marks items as indexed for this index. | 2 |
TrackerInterface:: |
public | function | Inserts new items into the tracking system for this index. | 2 |
TrackerInterface:: |
public | function | Marks the given items as updated for this index. | 2 |