Home » Performance » FullText » AND as the default modifier for boolean search
icon5.gif  AND as the default modifier for boolean search [message #2078] Wed, 17 October 2007 07:28
Spuerhund  is currently offline Spuerhund
Messages: 4
Registered: August 2007
Junior Member
I would like to offer my users the same behaviour that they are already used to. Let's take for example Google. Google has "AND" as the default operator, which means that you get less and less results with every word that you add to your first query.

In MySQL the default modifier is (according to the manual
http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html):
(no operator)
By default (when neither + nor - is specified) the word is optional, but the rows that contain it are rated higher. This mimics the behavior of MATCH() ... AGAINST() without the IN BOOLEAN MODE modifier.


That sounds nice, but acctually in most cases it just sucks. The result gets worse when you add another keyword to a one-word query and most users are confused when they now get results which didn't appear in the first result set, because they wanted to "filter" the first result even more.

Unfortunately, in all the years i haven't found a single user so far who was willingly to read the "HOW TO" explanation of my search function and went through a short crash course of boolean operators and "strange signs" (many don't even know where + and - are hiding on their keyboard). That's just a fact.

Therefore it would be very convenient to change the default operator to "+", so that without any given operator MySQL uses AND in case more than one word is given.

So far i haven't found a pure MySQL solution and it looks like i have to write my own query parser to split every query by "..." and (...) phrases, then by words, etc. and then add the missing "+" sign in front of every word without a modifier. Friendly, i am not eager to do that, as this should be done by the DB and not by some application logic on top.

What could be done? Any suggestions are welcome ... Confused
Previous Topic:Logic behind full text search index
Next Topic:Slow COUNT query that uses a fulltext index
Goto Forum:
  



Current Time: Thu Jul 3 19:49:12 EDT 2008

Total time taken to generate the page: 0.01038 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge