Index: search404.module =================================================================== --- search404.module (revision 1342) +++ search404.module (working copy) @@ -103,6 +103,8 @@ drupal_set_title(t('Page not found')); if (module_exists('search') && user_access('search content')) { $keys = ""; + // if apachesolr_search is installed use apachesolr_search instead default node search + $type_search = (module_exists('apachesolr_search')) ? 'apachesolr_search' : 'node'; if (variable_get('search404_use_search_engine', false)) { $keys = search404_search_engine_query(); } @@ -111,7 +113,7 @@ } if ($keys) { // TODO: watchdog? - $results = module_invoke('node', 'search', 'search', $keys); + $results = module_invoke($type_search, 'search', 'search', $keys); if (isset($results) && is_array($results) && count($results) == 1 && variable_get('search404_jump', false)) { // First, check to see if there is exactly 1 result drupal_set_message(t('The page you requested does not exist. A search for %keys resulted in this page.', array('%keys' => check_plain($keys))), 'status'); @@ -133,7 +135,7 @@ $oldgetq = $_GET['q']; $olddestination = $_REQUEST['destination']; unset($_REQUEST['destination']); - $_GET['q'] = "search/node/$keys"; + $_GET['q'] = "search/$type_search/$keys"; $results = theme('search_results', $results, 'node'); $_GET['q'] = $oldgetq; $_REQUEST['destination'] = $olddestination; @@ -146,7 +148,7 @@ } } // Construct the search form. - $output = drupal_get_form('search_form', NULL, $keys, 'node') . $results; + $output = drupal_get_form('search_form', NULL, $keys, $type_search) . $results; } /*