You are here

function node_reindex_node_search in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/node.module \node_reindex_node_search()
  2. 9 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
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 1243
The core module that allows content to be submitted to the site.

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);
  }
}