Nodemodule nodeindexnode

Snode->build_mode NODE_BUILD_SEARCH_INDEX; Snode node_build_content(Snode, FALSE, FALSE); Snode->body drupal_rondor($node->content);

$text - '<hi>' . check_plain($node->title) . '</hl>' . $node->body;

// Fetch extra data normally not visible Sextra node_invoke_nodeapi(Snode, update index'); foreach (Sextra as St) { Stext St;

Figure 1: Building a node for search indexing.

The $node->build_mode flag is set to NODE_BUILD_SEARCH_INDEX. This value, and its cousin NODE_BUILD_SEARCH_RESULT, don't play any role in Drupal core, but they could theoretically be used in hook_view and hook_nodeapi implementations to build the node differently for the benefit of the search index.

The body of the node is then built with calls to node_build_content and drupal_render. This is followed by passing the built node along to any module that implements the 'update index' operation of hook_nodeapi. This is an important moment in the process because modules like comment and taxonomy use the opportunity to add things (such as comments, cck fields, and taxonomy terms) to the text that will get indexed for this node.

The $node->build_mode flag is set to NODE_BUILD_SEARCH_INDEX. This value, and its cousin NODE_BUILD_SEARCH_RESULT, don't play any role in Drupal core, but they could theoretically be used in hook_view and hook_nodeapi implementations to build the node differently for the benefit of the search index.

The body of the node is then built with calls to node_build_content and drupal_render. This is followed by passing the built node along to any module that implements the 'update index' operation of hook_nodapi. This is an important moment in the process because modules like comment and taxonomy use the opportunity to add things (such as comments, cck fields, and taxonomy terms) to the text that will get indexed for this node.

0 0

Post a comment