? 8389
? Unsaved Document 1
? cache_42_0.patch
? cache_get_multiple-333171-39.patch.1
? cache_get_multiple-333171-39.patch.2
? comment.diff
? comment_load_multiple.patch
? comment_paging_24.patch.1
? comment_paging_24.patch.2
? comment_paging_7.patch.1
? comments.png
? comments_as_tab.patch
? comments_as_tab.patch.1
? comments_as_tab_0.patch
? content.png
? d7ux_header_jun14.tar
? diff.txt
? drupal-split-total2.patch.1
? enable_search.patch
? fieldset.png
? menu.module_12.patch
? modules (2)
? registry.png
? remove_primary_secondary.patch
? search_index_content.patch
? semantic_but_ugly.png
? taxonomy_term.patch
? taxonomy_term.patch.1
? uninstall.patch
? user_modules_uninstalled.patch
? user_modules_uninstalled_with_tests_9.patch
? modules/comments_as_tab.patch
? modules/comment/.comment.test.rej.swp
? modules/comment/comment_paging.patch
? modules/field/field.autoload.inc
? modules/simpletest/tests/.module.test.swp
? modules/system/.system.install.swp
? modules/system/system.actions.inc
? modules/system/system.autoload.inc
? modules/system/system.block.inc
? modules/system/system.build.inc
? modules/system/system.cron.inc
? modules/system/system.file.inc
? modules/system/system.form.inc
? modules/system/system.mail.inc
? modules/system/system.registry.inc
? modules/system/system.update
? modules/user/user.autoload.inc
? scripts/generate-autoload.pl
? scripts/generate-autoload.sh
? sites/all/modules/contrib
? sites/default/files
? sites/default/settings.php
? sites/default/settings.php.back
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1073
diff -u -p -r1.1073 node.module
--- modules/node/node.module	24 Jun 2009 18:16:38 -0000	1.1073
+++ modules/node/node.module	27 Jun 2009 16:34:40 -0000
@@ -2028,7 +2028,7 @@ function node_update_index() {
   $result = db_query_range("SELECT n.nid 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 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit);
 
   foreach ($result as $node) {
-    _node_index_node($node);
+    node_index_node($node);
   }
 }
 
@@ -2038,7 +2038,7 @@ function node_update_index() {
  * @param $node
  *   The node to index.
  */
-function _node_index_node($node) {
+function node_index_node($node) {
   $node = node_load($node->nid);
 
   // Save the changed time of the most recent indexed node, for the search
Index: modules/search/search.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.admin.inc,v
retrieving revision 1.8
diff -u -p -r1.8 search.admin.inc
--- modules/search/search.admin.inc	11 Jan 2009 21:19:18 -0000	1.8
+++ modules/search/search.admin.inc	27 Jun 2009 16:34:40 -0000
@@ -69,6 +69,12 @@ function search_admin_settings() {
     '#type' => 'fieldset',
     '#title' => t('Indexing settings')
   );
+  $form['indexing_settings']['search_index_node_insert'] = array(
+    '#title' => t('Index content when created'),
+    '#type' => 'checkbox',
+    '#default_value' => variable_get('search_index_node_insert', TRUE),
+    '#description' => t('Search module will index content as soon as it is created instead of waiting for a cron run. Not recommended for high traffic sites.'),
+  );
   $form['indexing_settings']['info'] = array(
     '#markup' => t('<p><em>Changing the settings below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</em></p><p><em>The default settings should be appropriate for the majority of sites.</em></p>')
   );
Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.298
diff -u -p -r1.298 search.module
--- modules/search/search.module	3 Jun 2009 06:52:29 -0000	1.298
+++ modules/search/search.module	27 Jun 2009 16:34:41 -0000
@@ -655,6 +655,18 @@ function search_node_update_index($node)
 }
 
 /**
+ * Implement hook_node_insert().
+ */
+function search_node_insert($node) {
+  // Index nodes when first created so that the immediately show up in search
+  // results.
+  if (variable_get('search_index_node_insert', TRUE)) {
+    node_index_node($node);
+    search_update_totals();
+  }
+}
+
+/**
  * Implement hook_node_update().
  */
 function search_node_update($node) {
