function search_node_update_index

Implements hook_node_update_index().

File

modules/search/search.module, line 794

Code

function search_node_update_index($node) {
    // Transplant links to a node into the target node.
    $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = :nid", array(
        ':nid' => $node->nid,
    ), array(
        'target' => 'slave',
    ));
    $output = array();
    foreach ($result as $link) {
        $output[] = $link->caption;
    }
    if (count($output)) {
        return '<a>(' . implode(', ', $output) . ')</a>';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.