- Accessibility
- Actions
- Blog
- Bootstrap
- Calendar
- Code Snippets
- Core Hacks
- Cron
- Development Environment
- Drupal 7
- Flash
- Forms
- Goodies
- Hooks
- Hosting
- Images
- Installation, Updating and Moving
- Internationalization
- Javascript/JQuery
- Learning Drupal (New Users)
- Login/User Management/Permissions
- Logs
- Menus
- Modules
- Nodes
- Paths
- Performance
- RSS
- Reference Sites
- Registry
- Reporting
- Reporting Bugs/Issues
- SEO
- Schema
- Search
- Security
- SimpleTest
- Sites
- Support
- Testing
- Themes
- Troubleshooting
- Upgrading
- User Groups
- Workflow
Submitted by captaindav on Tue, 2010-04-20 07:07
Requires installing the Solr Search Module: http://drupal.org/project/apachesolr .
Once you have your Solr server up and running, and have configured it to work with Drupal at /admin/settings/apachesolr, you must configure the Drupal Search Form to work with Solr as follows:
<?php
/**
* Implementation of hook_form_alter()
*/
function your_custom_module_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'search_theme_form') {
$form['#submit'][] = 'your_custom_module_search_submit';
}
}
/**
* Re-direct Search Form Submit
*/
function your_custom_module_search_submit($form, &$form_state) {
$form_id = $form['form_id']['#value'];
$form_state['redirect']='search/apachesolr_search/'. trim($form_state['values'][$form_id]);
}
?>