function node_reindex_node_search
Same name in other branches
- 9 core/modules/node/node.module \node_reindex_node_search()
- 10 core/modules/node/node.module \node_reindex_node_search()
- 11.x core/modules/node/node.module \node_reindex_node_search()
Marks a node to be re-indexed by the node_search plugin.
Parameters
int $nid: The node ID.
4 calls to node_reindex_node_search()
- Node::postSave in core/
modules/ node/ src/ Entity/ Node.php - Acts on a saved entity before the insert or update hook is invoked.
- node_comment_delete in core/
modules/ node/ node.module - Implements hook_ENTITY_TYPE_delete() for comment entities.
- node_comment_insert in core/
modules/ node/ node.module - Implements hook_ENTITY_TYPE_insert() for comment entities.
- node_comment_update in core/
modules/ node/ node.module - Implements hook_ENTITY_TYPE_update() for comment entities.
File
-
core/
modules/ node/ node.module, line 1427
Code
function node_reindex_node_search($nid) {
if (\Drupal::moduleHandler()->moduleExists('search')) {
// Reindex node context indexed by the node module search plugin.
\Drupal::service('search.index')->markForReindex('node_search', $nid);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.