diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/node.module | 2 | ||||
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/search.module | 6 | ||||
-rw-r--r-- | modules/search/search.module | 6 |
4 files changed, 12 insertions, 4 deletions
diff --git a/modules/node.module b/modules/node.module index 672b3bdb1..76270f76e 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1556,7 +1556,7 @@ function node_update_index() { // cannot be indexed (PHP nodes which call drupal_goto, for example). // In rare cases this can mean a node is only partially indexed, but the // chances of this happening are very small. - variable_set('node_cron_last', max($last_comment, max($node->changed, $node->created))); + variable_set('node_cron_last', max($last_comment, $node->changed, $node->created)); if (node_hook($node, 'view')) { node_invoke($node, 'view', false, false); diff --git a/modules/node/node.module b/modules/node/node.module index 672b3bdb1..76270f76e 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1556,7 +1556,7 @@ function node_update_index() { // cannot be indexed (PHP nodes which call drupal_goto, for example). // In rare cases this can mean a node is only partially indexed, but the // chances of this happening are very small. - variable_set('node_cron_last', max($last_comment, max($node->changed, $node->created))); + variable_set('node_cron_last', max($last_comment, $node->changed, $node->created)); if (node_hook($node, 'view')) { node_invoke($node, 'view', false, false); diff --git a/modules/search.module b/modules/search.module index 27ecb0ba9..25f767bda 100644 --- a/modules/search.module +++ b/modules/search.module @@ -127,7 +127,7 @@ function search_admin() { $output = form_group(t('Indexing settings'), $group); // Collect some stats - $estimate = db_result(db_query('SELECT COUNT(DISTINCT sid) FROM {search_index}')); + $estimate = variable_get('search_indexed', 0); $nodes = max(1, db_result(db_query('SELECT COUNT(*) FROM {node}'))); $percentage = ((int)min(100, 100 * $estimate / $nodes)) . '%'; $status = '<p>'. t('Approximately %percentage of the site has been indexed.', array('%percentage' => $percentage)) .'</p>'; @@ -200,6 +200,10 @@ function search_cron() { while ($word = db_fetch_object($result)) { db_query("DELETE FROM {search_total} WHERE word = '%s'", $word->realword); } + + // Count indexed items (for administration screen) + $indexed = db_result(db_query('SELECT COUNT(DISTINCT sid) FROM {search_index}')); + variable_set('search_indexed', $indexed); } /** diff --git a/modules/search/search.module b/modules/search/search.module index 27ecb0ba9..25f767bda 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -127,7 +127,7 @@ function search_admin() { $output = form_group(t('Indexing settings'), $group); // Collect some stats - $estimate = db_result(db_query('SELECT COUNT(DISTINCT sid) FROM {search_index}')); + $estimate = variable_get('search_indexed', 0); $nodes = max(1, db_result(db_query('SELECT COUNT(*) FROM {node}'))); $percentage = ((int)min(100, 100 * $estimate / $nodes)) . '%'; $status = '<p>'. t('Approximately %percentage of the site has been indexed.', array('%percentage' => $percentage)) .'</p>'; @@ -200,6 +200,10 @@ function search_cron() { while ($word = db_fetch_object($result)) { db_query("DELETE FROM {search_total} WHERE word = '%s'", $word->realword); } + + // Count indexed items (for administration screen) + $indexed = db_result(db_query('SELECT COUNT(DISTINCT sid) FROM {search_index}')); + variable_set('search_indexed', $indexed); } /** |