Active
Project:
Core searches
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2008 at 19:25 UTC
Updated:
25 Nov 2009 at 16:38 UTC
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
Comment #1
kyle_mathews commentedThanks Kevin -- I was looking for how to do this. It worked perfectly.
Comment #2
pvasener commentedAnother 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';