/ Published in: PHP
force fields to be added to the search index on update
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Implementation of hook_nodeapi() * For adding additional data to search index * */ function sitehelper_nodeapi(&$node, $op, $teaser, $page) { switch ($op) { //Update search index with keyword fields contents case 'update': if($node->type == 'product') { //Add field data to be indexed. search_index($node->nid,'node', $node->field_search_keywords[0]['value']); } break; } }