Skip to content

dart-creations.com

Advertisement
Home arrow Joomla arrow Joomla Tips and Tricks arrow #14 - Optimize the default search options
Print E-mail
Tuesday, 14 August 2007

#14 - Optimize the default search options

By default the Joomla search searches for any word. That is if you look for "Joomla components", you will find any page which contains either Joomla or components. People require AND search. The following hack to the core code will enable all words searching by default.

In /components/com_search/search.html.php:

Find:               $searchphrase     = strtolower( strval( mosGetParam( $_REQUEST, 'searchphrase', 'any' ) ) );
Change to:      $searchphrase     = strtolower( strval( mosGetParam( $_REQUEST, 'searchphrase', 'all' ) ) );
This occurs twice in approximaletely lines 126 and 215

Also, in /components/com_search/search.php: 

Find:            $searchphrase = mosGetParam( $_REQUEST, 'searchphrase', 'any' );

Change to:   $searchphrase = mosGetParam( $_REQUEST, 'searchphrase', 'all' );
This occurs in approximately line 103

Rememer to make a backup of each files in case something goes wrong. 

Comments
Search RSS
voinsvetii     |89.185.88.xxx |2009-06-01 19:21:56
?????? ???? ?????? ????????? ?? ???-?? ????? ???????? ...
MishkOO     |89.185.88.xxx |2009-06-06 00:00:15
????????? ).. ???? ???-?? ???????? ?? ???? ????????? ?????? ...
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Wednesday, 01 October 2008 )
 

Sponsors

Login Form






Lost Password?
No account yet? Register

Buy us a beer!

If we've helped you, consider buying a beer €3. It will inspire us to keep on giving! Cheers!


Generated in 0.22070 Seconds