#60729: Index taxonomy terms with nodes
parent
546f5930a4
commit
954cbf7c65
|
@ -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),
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue