? failure_fallback.patch
Index: apachesolr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr.module,v
retrieving revision 1.1.2.20
diff -u -p -r1.1.2.20 apachesolr.module
--- apachesolr.module	20 Jul 2008 10:33:15 -0000	1.1.2.20
+++ apachesolr.module	14 Aug 2008 00:29:02 -0000
@@ -59,6 +59,13 @@ function apachesolr_settings() {
     '#options' => $options,
     '#description' => t('The number of results that will be shown per page.'),
     );
+  $form['apachesolr_failure'] = array(
+    '#type' => 'select',
+    '#title' => t('On failure'),
+    '#options' => array('show_error'=>t('Show Error'), 'show_drupal_results'=>t('Show Drupal Results'), 'show_no_results'=>t('Show No Results')),
+    '#default_value' => variable_get('apachesolr_failure', 'show_error'),
+    '#description' => t('What to display if Apache Solr search is not available'),
+    );  
   return system_settings_form($form);
 }
 
Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.13
diff -u -p -r1.1.2.13 apachesolr_search.module
--- apachesolr_search.module	19 Jul 2008 18:16:57 -0000	1.1.2.13
+++ apachesolr_search.module	14 Aug 2008 00:29:02 -0000
@@ -108,9 +108,26 @@ function apachesolr_search_search($op = 
 
       } // try
       catch (Exception $e) {
+        apachesolr_failure($query->get_query());
         watchdog('Apache Solr', $e->getMessage(), WATCHDOG_ERROR);
       }
       break;
 
   } // switch
 }
+function apachesolr_failure($querystring) {
+  
+  $fail_rule = variable_get('apachesolr_failure', 'show_error');
+  
+  switch ($fail_rule) {
+    case 'show_error':
+      drupal_set_message('The Apache Solr search engine is not available.  Please contact your site administrator', 'error');
+      break;
+    case 'show_drupal_results':
+      drupal_goto("search/node/". $querystring);
+      break;
+    case 'show_no_results':
+      return;
+      break;
+  }
+}
