In Drupal 7, a particular module's implementation of hook_update_index() only actually runs if search.module is enabled, and also if on the Search configuration page, your module has been enabled as an active Search module.

See http://api.drupal.org/api/function/search_cron/7 :

  foreach(variable_get('search_active_modules', array('node', 'user')) as $module) {
    // Update word index
    module_invoke($module, 'update_index');
  }

This needs to be documented on http://api.drupal.org/api/function/hook_update_index/7 -- Currently it just says hook_update_index runs in every cron run. This should probably also be documented on the module update guide, as it is a change from Drupal 6 behavior (and I have one data point, myself, of a module developer being caught by it).

CommentFileSizeAuthor
#1 704866.patch9.22 KBjhodgdon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Title: hook_update_index() needs doc addition » Search API doc has some problems
Status: Active » Needs review
FileSize
9.22 KB

Ugh. There were all sorts of other issues with the Search API doc in search.api.php, so here's a big patch to fix it up.

jhodgdon’s picture

The above patch also fixes #699532: hook_search_execute() doc mentions do_search(), which I've marked as a duplicate of this issue.

mvc’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs documentation

patch looks great to me. thanks, jhodgdon!

added to the handbook's page on converting modules: http://drupal.org/update/modules/6/7#hook_update_index

#d7csmtl

mvc’s picture

properly tagging for posterity...

mvc’s picture

Issue tags: +D7csmtl

trying that again...

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD.

Status: Fixed » Closed (fixed)
Issue tags: -D7csmtl

Automatically closed -- issue fixed for 2 weeks with no activity.