Index: apachesolr_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr/apachesolr_search.module,v
retrieving revision 1.1.2.6.2.111.2.10
diff -u -r1.1.2.6.2.111.2.10 apachesolr_search.module
--- apachesolr_search.module	27 Aug 2009 20:07:02 -0000	1.1.2.6.2.111.2.10
+++ apachesolr_search.module	28 Aug 2009 22:00:14 -0000
@@ -156,7 +156,7 @@
       $filters = trim($_GET['filters']);
     }
     // Only perform search if there is non-whitespace search term or filters:
-    if ($keys || $filters) {
+    if ($keys || $filters || variable_get('apachesolr_search_browse', 'browse') == 'results') {
       // Log the search keys:
       $log = $keys;
       if ($filters) {
@@ -177,10 +177,20 @@
       // Ignore $type == node. Since we override the menu path to search to point
       // to this function, we have to count on core searches coming in here, too.
 
-      // Show search form and browse-by blocks.
-      $blocks = apachesolr_search_browse('', '', '', 'search/' . $type);
-      if (count($blocks) > 0) {
-        $content = theme('apachesolr_browse_blocks', $blocks);
+      switch (variable_get('apachesolr_search_browse', 'browse')) {
+        case 'browse':
+          // Show search form and browse-by blocks.
+          $blocks = apachesolr_search_browse('', '', '', 'search/' . $type);
+          if (count($blocks) > 0) {
+            $content = theme('apachesolr_browse_blocks', $blocks);
+          }
+          break;
+        case 'blocks':
+          // Launch search so that hook_block() will show blocks.
+          $dummy = search_data($keys, $type);
+          break;
+        default:
+          break;
       }
     }
   }
@@ -204,6 +214,7 @@
   apachesolr_search_add_facet_params($params, $query);
   $solr = apachesolr_get_solr();
   apachesolr_current_query($query);
+  apachesolr_modify_query($query, $params, 'apachesolr');
   $response = $solr->search('', $params['start'], $params['rows'], $params);
   if (empty($response)) {
     return;
@@ -945,6 +956,21 @@
  * This adds options to the apachesolr admin form.
  */
 function apachesolr_search_form_apachesolr_settings_alter(&$form, $form_state) {
+  $form['apachesolr_search_browse'] = array(
+    '#type' => 'radios',
+    '#title' => t('Behavior on empty search'),
+    '#options' => array(
+      'none' => t("Show search box"),
+      'browse' => t("Show search box and enabled filters' blocks under the search box"),
+      'blocks' => t("Show search box and enabled filters' blocks in their configured regions"),
+      'results' => t("Show search box, first page of all available results, and enabled filters' blocks in their configured regions"),
+    ),
+    '#default_value' => variable_get('apachesolr_search_browse', 'browse'),
+    '#description' => t("This is what is shown when the user enters an empty search, or removes all filters from an active search. Remember to enable filters on the !filterslink and assign blocks to regions on the !blocklink", array(
+      '!filterslink' => l('enabled filters page', 'admin/settings/apachesolr/enabled-filters'),
+      '!blocklink' => l('block settings page', 'admin/build/block'),
+    )),
+  );
   $form['advanced']['apachesolr_search_make_default'] = array(
     '#type' => 'radios',
     '#title' => t('Make Apache Solr Search the default'),

