How to remove a specific item from the search index?
Looking at the code executed from node_delete_multiple() (which is then the function used by node_delete()), I see that the function called is search_reindex().

    // Remove this node from the search index if needed.
    // This code is implemented in node module rather than in search module,
    // because node module is implementing search module's API, not the other
    // way around.
    if (module_exists('search')) {
      search_reindex($nid, 'node');
    }


The code executed from that function to delete rows from the search tables is the following one.

db_delete('search_dataset')
  -&gt;condition('sid', $sid)
  -&gt;condition('type', $module)
  -&gt;execute();

db_delete('search_index')
  -&gt;condition('sid', $sid)
  -&gt;condition('type', $module)
  -&gt;execute();

// Don't remove links if re-indexing.
if (!$reindex) {
  db_delete('search_node_links')
    -&gt;condition('sid', $sid)
    -&gt;condition('type', $module)
    -&gt;execute();
}


I suggest using search_reindex(), but to reply to your question, it doesn't seem that updating the "search_total" table is necessary, at this point; Drupal doesn't do it when a node is deleted. That table is updated from search_update_totals(), which is called from search_cron(). See the comment given for the following code, executed from search_update_totals().

  // Find words that were deleted from search_index, but are still in
  // search_total. We use a LEFT JOIN between the two tables and keep only the
  // rows which fail to join.
  $result = db_query("SELECT t.word AS realword, i.word FROM {search_total} t LEFT JOIN {search_index} i ON t.word = i.word WHERE i.word IS NULL", array(), array('target' =&gt; 'slave'));
  $or = db_or();
  foreach ($result as $word) {
    $or-&gt;condition('word', $word-&gt;realword);
  }
  if (count($or) &gt; 0) {
    db_delete('search_total')
      -&gt;condition($or)
      -&gt;execute();
  }


In Drupal 6, the equivalent of search_reindex() is search_wipe(), which is called from node_delete(). The function contains the following code to delete the tables' content.

db_query("DELETE FROM {search_dataset} WHERE sid = %d AND type = '%s'", $sid, $type);
db_query("DELETE FROM {search_index} WHERE sid = %d AND type = '%s'", $sid, $type);
// Don't remove links if re-indexing.
if (!$reindex) {
  db_query("DELETE FROM {search_node_links} WHERE sid = %d AND type = '%s'", $sid, $type);
}


Also in this case, I suggest using search_wipe().