I ended up with the below patch that seems to do the trick. The patch looks much larger than it needs to because I corrected the indentation after I removed an if
.
Anyone that considers using this patch should be aware that this will hack the module. You should understand what that means, and be using a make file to avoid future complications.
$ diff -u apachesolr_search.module_ apachesolr_search.module
--- apachesolr_search.module_ 2013-02-11 10:12:17.814561087 +0100
+++ apachesolr_search.module 2013-02-11 13:29:10.450336901 +0100
@@ -159,24 +159,22 @@
if (isset($_GET['filters'])) {
$filters = trim($_GET['filters']);
}
- // Only perform search if there is non-whitespace search term or filters:
- if ($keys || $filters) {
- // Log the search keys:
- $log = $keys;
- if ($filters) {
- $log .= 'filters='. $filters;
- }
- watchdog('search', '%keys (@type).', array('%keys' => $log, '@type' => t('Search')), WATCHDOG_NOTICE, l(t('results'), 'search/'. $type .'/'. $keys));
- // Collect the search results:
- $results = search_data($keys, $type);
+ // Log the search keys:
+ $log = $keys;
+ if ($filters) {
+ $log .= 'filters='. $filters;
+ }
+ watchdog('search', '%keys (@type).', array('%keys' => $log, '@type' => t('Search')), WATCHDOG_NOTICE, l(t('results'), 'search/'. $type .'/'. $keys));
- if ($results) {
- $results = theme('box', t('Search results'), $results);
- }
- else {
- $results = theme('box', t('Your search yielded no results'), variable_get('apachesolr_search_noresults', apachesolr_search_noresults()));
- }
+ // Collect the search results:
+ $results = search_data($keys, $type);
+
+ if ($results) {
+ $results = theme('box', t('Search results'), $results);
+ }
+ else {
+ $results = theme('box', t('Your search yielded no results'), variable_get('apachesolr_search_noresults', apachesolr_search_noresults()));
}
if (empty($form)) {
// The form may be altered based on the query that was run.
@@ -998,9 +996,6 @@
$get['retain-filters'] = '1';
}
$form_state['redirect'] = array($base . $keys, $get);
- if ($keys == '' && !$queryvalues) {
- form_set_error('keys', t('Please enter some keywords.'));
- }
}