diff --git a/modules/node.module b/modules/node.module index 5be1c028967b492b13d6dfc564b47cb29fce73dd..3a57c1c873d6a011e51ce3212a765c3e6fb71280 100644 --- a/modules/node.module +++ b/modules/node.module @@ -716,6 +716,8 @@ function node_search($op = 'search', $keys = null) { // Fetch comments for snippet $node->body .= module_invoke('comment', 'nodeapi', $node, 'update index'); + // Fetch terms for snippet + $node->body .= module_invoke('taxonomy', 'nodeapi', $node, 'update index'); $extra = node_invoke_nodeapi($node, 'search result'); $results[] = array('link' => url('node/'. $item->sid), diff --git a/modules/node/node.module b/modules/node/node.module index 5be1c028967b492b13d6dfc564b47cb29fce73dd..3a57c1c873d6a011e51ce3212a765c3e6fb71280 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -716,6 +716,8 @@ function node_search($op = 'search', $keys = null) { // Fetch comments for snippet $node->body .= module_invoke('comment', 'nodeapi', $node, 'update index'); + // Fetch terms for snippet + $node->body .= module_invoke('taxonomy', 'nodeapi', $node, 'update index'); $extra = node_invoke_nodeapi($node, 'search result'); $results[] = array('link' => url('node/'. $item->sid), diff --git a/modules/taxonomy.module b/modules/taxonomy.module index dedab9429c5674288400d90abddbc7e380dfeff6..149f8bf8403eff1481ec437061746892ef808cf6 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -1182,7 +1182,21 @@ function taxonomy_nodeapi($node, $op, $arg = 0) { break; case 'rss item': return taxonomy_rss_item($node); - break; + case 'update index': + return taxonomy_node_update_index($node); + } +} + +/** + * Implementation of hook_nodeapi('update_index'). + */ +function taxonomy_node_update_index(&$node) { + $output = array(); + foreach ($node->taxonomy as $term) { + $output[] = $term->name; + } + if (count($output)) { + return '<strong>('. implode(', ', $output) .')</strong>'; } } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index dedab9429c5674288400d90abddbc7e380dfeff6..149f8bf8403eff1481ec437061746892ef808cf6 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1182,7 +1182,21 @@ function taxonomy_nodeapi($node, $op, $arg = 0) { break; case 'rss item': return taxonomy_rss_item($node); - break; + case 'update index': + return taxonomy_node_update_index($node); + } +} + +/** + * Implementation of hook_nodeapi('update_index'). + */ +function taxonomy_node_update_index(&$node) { + $output = array(); + foreach ($node->taxonomy as $term) { + $output[] = $term->name; + } + if (count($output)) { + return '<strong>('. implode(', ', $output) .')</strong>'; } }