This allows users to search for all of a list of search
terms instead of displaying stories which match any of
the words. The default operator is still OR, but
search.pl contains a new dropdown which can be used to
select AND instead. This default can be changed with a
simple edit to search.pl by modifying the line where
$form->{boolean_type} is initialized. Only story
searching is fixed with this patch, but it would be
easy to extend to other searches.
On the site I tested this patch, story_text has 5,590
rows, and is 11.6 MB. Normal searches took about 0.3
seconds, and AND searches about 1.3 seconds. This load
increase should be acceptable for most sites running slash.
Eventually this and other search options should be
implemented using IN BOOLEAN MODE fulltext searching, a
feature added to MySQL in version 4.0.1 (see
http://www.mysql.com/doc/en/Fulltext_Search.html\), but
this patch will work until then.
Patch to searchform;search;default, search.pl, and Search.pm