SearchIndex
class SearchIndex implements SearchIndexInterface (View source)
Provides search index management functions.
Properties
| protected ConfigFactoryInterface | $configFactory | The config factory. |
|
| protected Connection | $connection | The database connection. |
|
| protected Connection | $replica | The database replica connection. |
|
| protected CacheTagsInvalidatorInterface | $cacheTagsInvalidator | The cache tags invalidator. |
Methods
SearchIndex constructor.
Updates the full-text search index for a particular item.
Clears either a part of, or the entire search index.
Changes the timestamp on indexed items to 'now' to force reindexing.
Updates the {search_total} database table.
Details
__construct(ConfigFactoryInterface $config_factory, Connection $connection, Connection $replica, CacheTagsInvalidatorInterface $cache_tags_invalidator)
SearchIndex constructor.
string[]
index(string $type, int $sid, string $langcode, string $text, bool $update_weights = TRUE)
Updates the full-text search index for a particular item.
clear(string|null $type = NULL, int|array|null $sid = NULL, string|null $langcode = NULL)
Clears either a part of, or the entire search index.
This function is meant for use by search page plugins, or for building a user interface that lets users clear all or parts of the search index.
markForReindex(string $type = NULL, int $sid = NULL, string $langcode = NULL)
Changes the timestamp on indexed items to 'now' to force reindexing.
This function is meant for use by search page plugins, or for building a user interface that lets users mark all or parts of the search index for reindexing.
updateWordWeights(array $words)
Updates the {search_total} database table.