First we need the modules: Search Lucene API & Inline Ajax Search. Also download modules that these two has a dependency on. Read the INSTALL.txt file in the Lucene modules directory. After that enable the following modules. * Inline AJAX search * Search Lucene API * Search Lucene Content Tip: Installing and enabling modules is a piece of cake with Drush. Now go to the settings page for Lucene /admin/settings/luceneapi. Set the Hijack search box setting to Lucene search. Go to the setting for Search Lucene content /admin/settings/luceneapi_node/general. Check the Hide core search checkbox. It's also recommended that you set the Search name to something else, content maybe? Now switch to the Content bias tab on the top of the page. Here you can customize how important different fields and type of content etc is to the search result. The other settings should work but click through the tabs and change settings for your needs. Put the Inline AJAX search form block in the region were you want it displayed (You can do this with Context module, Panels module or at Drupals default Block settings page /admin/build/blocks). You should now be able to see the new search form. Go to /admin/user/permissions and choose which roles should be allowed to use the search (search with inline_ajax_search). To be able to use the new search the content of your site has to be indexed. This is done when Cron is run so make sure you have your cron jobs configured or type in /admin/reports/status/run-cron in your browser. You can now test out the new search form. You should style it for your needs with some CSS. If you pres Enter after the word you're searching for you will be taken to the search page. You can see an example of the search at here. This was just a basic tutorial for replacing Drupals standard search with something better. If you want you can get the "Did you mean"-functionality with Search Lucene DidYouMean. You could also take a look at Lucenes built in faceted search options that come with the module. Also check out the related modules on Lucenes project page.
Drupals built in search functionality isn't the best. But what's good is that it's not to hard to make it better. Here's a simple tutorial built with the Search Lucene API module.
Comments