Posted By

ReeceMarsland on 12/01/09


Tagged

search index drupal nodeapi Drupal6x


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

karmacode


Drupal force search index on update


 / Published in: PHP
 

force fields to be added to the search index on update

  1. /**
  2. * Implementation of hook_nodeapi()
  3. * For adding additional data to search index
  4. *
  5. */
  6. function sitehelper_nodeapi(&$node, $op, $teaser, $page) {
  7. switch ($op) {
  8.  
  9. //Update search index with keyword fields contents
  10. case 'update':
  11. if($node->type == 'product') {
  12. //Add field data to be indexed.
  13. search_index($node->nid,'node', $node->field_search_keywords[0]['value']);
  14. }
  15. break;
  16. }
  17. }

Report this snippet  

You need to login to post a comment.