I was having some difficulty getting cron to complete, so I decided to re-index my search index based on comments in some replies. After doing so, cron seems as though it is completing successfully.

However, the search setting page always says the site is at 0% indexed, even though it should be indexing 100 items per run and has run easily 10-15 times. Additionally, the count of remaining items never lowers.

I examined my database and noticed search_dataset, search_index and search_total seem to still have thousands of rows each. Am I wrong in assuming that these tables should have been emptied when I clicked "reindex"? If they should have, is it safe for me to drop these tables?

Comments

nmashruwala’s picture

subscribing

ainigma32’s picture

Status: Active » Postponed (maintainer needs more info)

If you click the reindex button the search module invokes the hook_search with the $op parameter set to 'reset' .
The node module implements that part of the hook by deleting the variables 'node_cron_last' and 'node_cron_last_nid'

So the reindex button does not empty the tables you describe and you don't need to empty them (let alone drop them).

If you want to see which module is reporting the items that have to be indexed you can add something like this to the search_admin_settings function in search.module:

function search_admin_settings() {
  // Collect some stats
  $remaining = 0;
  $total = 0;
  foreach (module_list() as $module) {
    if (module_hook($module, 'search')) {
      $status = module_invoke($module, 'search', 'status');
      $remaining += $status['remaining'];
      $total += $status['total'];
      // add the next line for debugging
      watchdog('debug', $module . ' reports '. $status['total'] .' items and '. $status['remaining'] .' remaining.'); 
    }
  }

// ... snip ...

Please post back your findings.

- Arie

ainigma32’s picture

Status: Postponed (maintainer needs more info) » Fixed

Looks like sparq-l won't be posting any feedback so I'm setting this to fixed.

Feel free to reopen if you think that is wrong.

- Arie

Status: Fixed » Closed (fixed)

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