function node_reindex_node_search

Same name and namespace in other branches
  1. 10 core/modules/node/node.module \node_reindex_node_search()
  2. 9 core/modules/node/node.module \node_reindex_node_search()
  3. 8.9.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.

Deprecated

in drupal:11.3.0 and is removed from drupal:12.0.0. Use \Drupal::service('search.index')->markForReindex('node_search', $nid) instead.

See also

https://www.drupal.org/node/3533632

File

core/modules/node/node.module, line 557

Code

function node_reindex_node_search($nid) : void {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.3.0 and is removed from drupal:12.0.0. Use \\Drupal::service(\'search.index\')->markForReindex(\'node_search\', $nid); instead. See https://www.drupal.org/node/3533632', E_USER_DEPRECATED);
  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.