Hi I'm trying to change the default search form in the theme from ANDed to ORed, in order to be able and search in phrases containing any of the words instead of the complete phrase.
For instance if I'm looking for info about "Paris Hilton" but instead of writing the whole phrase I just write "Paris Hil"; by default it would lead to a no results page, but if ORed it would give me as a result any article containing at least the word "Paris".
I've tried doing this but with no success:
First I've added the following function override in template.php
and then I've created a file named search-theme-form.tpl.php with the following lines:
print drupal_get_token('search_theme_form'); " />
The first line replaces the default
But unfortunately when doing a search it returns the following message "Please enter some keywords.
".
Any help really appreciated since I'm going crazy with this one.
Thank you in advance.
Comments
sorry this is the code in
sorry this is the code in search-theme-form.tpl.php
Thanks again
Any help please?
Any help please?
Solution
I know this has been fours years--and I hope you see this---and may not even need it anymore but...
in root folder(with search module installed) go to modules/search
open up search.module
add this line: $keys = str_replace(' ',' OR ',$keys);
at ~line 1160 to function below so it looks like this:
Took me forever to find.