Using the drupal search block with the core searches patch uses drupal search. The block form does not specify an action, instead it redirects on submission. The only way I could get the block to submit to solr, was to alter the following function:

/**
 * Process a block search form submission.
 */
function search_box_form_submit($form, &$form_state) {
  $form_id = $form['form_id']['#value'];
  $type = array_shift(search_get_implementing_modules());
  // OLD METHOD
  //$form_state['redirect'] = "search/$type/". trim($form_state['values'][$form_id]);
  // REDIRECT TO SOLR
  $form_state['redirect'] = "search/apachesolr_search/". trim($form_state['values'][$form_id]);
}

Does that make sense?

Comments

kyle_mathews’s picture

Thanks Kevin -- I was looking for how to do this. It worked perfectly.

pvasener’s picture

Another way is to tweak of the modules implementing the search hook as $type picks up the first one. I personally ran this query to make ApacheSolr search engine default:
UPDATE system SET weight=-10 WHERE name='apachesolr_search';