Redirect Search Block to search/apachesolr_search
Kevin Hankens - December 1, 2008 - 19:25
| Project: | Core searches |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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?

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