Closed (fixed)
Project:
Views Fast Search
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Oct 2007 at 16:32 UTC
Updated:
29 Apr 2014 at 21:42 UTC
Jump to comment: Most recent
Comments
Comment #1
douggreen commentedStandard Drupal Search (and thus VFS) doesn't do partial word searching. That would be a cool feature, but kinda expensive to do. I think the way most search engines handle this is by doing some natural language conversion between root words and their plurals.
I think that the Fuzzy Search Module (a 2007 Summer of Code project) handles this.
Comment #2
kade commentedYou may like to check out porter stemmer. It does what you are looking for, ie it reduces a word to its stem, so 'marketing' will become 'market', 'adoption' to 'adopt' etc.
You can find a php class here:
http://www.phpguru.org/static/PorterStemmer.html
Comment #3
davidwhthomas commentedNot sure if anyone's still watching this interesting issue, but I got this functionality working by adding a LIKE operator to the query
details here:
http://drupal.org/node/201530
I assume the reason it's not in by default is performance?
Still it works fine for me and results a speedy.
thanks for the great module!
DT
Comment #4
narayan-1 commentedsend me a file to search option
Comment #5
dshelton commentedNot that I want to revive an old thread or anything but this is how I fixed it using the core search module.
I came across a duplicate issue here: http://drupal.org/node/498752 and found a patch here: http://drupal.org/files/issues/search.module_17.patch.
It seems people are having issues applying the patch so I manually changed the code in search.module as follows:
line 835: comment out $query2 = substr(str_repeat("i.word = '%s' OR ", count($arguments2)), 0, -4); and add: $query2 = substr(str_repeat("i.word like '%%%s%%' OR ", count($arguments2)), 0, -4);
line 861: comment out return array("d.data ". ($not ? 'NOT ' : '') ."LIKE '%% %s %%'", $num_new_scores, $num_valid_words); and add: return array("d.data ". ($not ? 'NOT ' : '') ."LIKE '%%%s%%'", $num_new_scores, $num_valid_words);
line 1188: comment out $boundary = '(?:(?<=['. PREG_CLASS_SEARCH_EXCLUDE . PREG_CLASS_CJK .'])|(?=['. PREG_CLASS_SEARCH_EXCLUDE . PREG_CLASS_CJK .']))'; and add: $boundary = '';
Obviously you could delete the old lines of code but I prefer to keep them there just in case. I've had great success with this, it's fast, and it doesn't appear to break anything. I'm running 6.20. My props to the original patch designer.
Comment #6
dfdavis commentedIf you don't want to hack into the core search module, you can create you own search module using the hook_search.
Comment #7
drupalfan81 commentedJust updated to latest version of drupal as of 4.26.2014 and this custom core search hack is still working. Thanks!
Comment #8
drupalfan81 commentedHey dshelton,
Since you came up with this hack, I wanted to ask...do you know if I will experience any decrease in speed/performance by making this hack?