Oh you get me wrong .. I get why AND is the default and would simply like a way to *force* an OR.
I was was simply replying to someone who said ".. MySQL has some support for full text search, but it is not perfect yet. I guess it just needs more time for MySQL to be mature on search feature .."
As we know mySql is capable of AND and OR even on full text.
DSig David Tod Sigafoos | SANMAR Corporation PICK Guy 206-770-5585 davesigafoos@sanmar.com
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Brion Vibber Sent: Tuesday, October 16, 2007 8:39 To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] Making search "and" by default
Dave Sigafoos wrote:
So MySql has to mature in order to get an OR selection?
Nope... MySQL's boolean fulltext search uses an OR logical operation by default, however this behavior is contrary to typical web search practice and gives uselessly overbroad results in most cases.
People normally expect that adding terms to their search query will *narrow* the result set (logical AND), whereas a logical OR *broadens* the result set. When common words are involved, you quickly get to the point where you get an insane number of results, very very few of which are relevant.
MediaWiki's MySQL search module thus produces its queries using logical AND in order to produce useful results in accordance with expectations. (In MySQL's boolean fulltext syntax, this prepends each term with a '+'.)
If you wanted you could switch the default to OR on your wiki by hacking a line in SearchMySQL4.php.
change: var $strictMatching = true;
to: var $strictMatching = false;
IMHO this would produce overbroad results by default; to narrow down your searches you would have to manually prepend a + to the search terms you wish to require, which would make it a lot harder to do typical searches.
Alternatively you could write up some kind of query parser that would take some desired alternate syntax (say, with the word 'OR' as an infix operator) to produce the proper MySQL boolean fulltext query.
For more info on the boolean fulltext seach, see: http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html
-- brion vibber (brion @ wikimedia.org)
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l