Hi,

I was checking the search indexing status on a site that I've been converting over to Drupal 6.x from 4.6.x. However, the search status would show something to the effect of:

"-16% of the site has been indexed. There are 395000 items left to index".

Which was strange because I had not implemented hook_search in any of my (or contributed) modules. I then found this bit of code for the node status:

      $total = db_result(db_query('SELECT COUNT(*) FROM {node} WHERE status = 1'));
      $remaining = db_result(db_query("SELECT COUNT(*) FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0"));
      return array('remaining' => $remaining, 'total' => $total);

While I understand that you want to know the valid number of nodes on the site, I'm wondering if instead total should be:

    $total = db_result(db_query('SELECT COUNT(*) FROM {node}'));

since that gives a grand total of all the nodes that would be indexed on the site. And that is what the search status should be concerned with (since it will be indexing nodes that have a status not equal to 1).

Comments

scoutbaker’s picture

Status: Active » Closed (duplicate)

Duplilcate of http://drupal.org/node/207734. That issue has a patch for review.