Dean,
Monday, September 16, 2002, 7:41:09 PM, you wrote:

DH> We're using MySQL 4.0.3-beta-nt. The new documentation for FULLTEXT searching says 
that phrases should be inside quotations, as for example:
 
DH>     SELECT title FROM booklist WHERE MATCH(title) AGAINST ('+"august 2002"' IN 
BOOLEAN MODE);
 
DH> The search engine I wrote for eMarketer, Inc. (www.emarketer.com) always treats 
arguments as if they ended in '*', so if a user is searching for 'japan' I will 
automatically match against
DH> '+japan*'. 
 
DH> However the new documentation doesn't say whether in the case of phrases the 
asterisk should appear inside or outside the quotes. I have tried both techniques 
experimentally and found that
DH> neither work correctly!

Currently phrase search doesn't work with operators, it's in the TODO
list. If somebody think that it works for him - it's a bug :)

DH> When you put the asterisk inside the quotes, as in
 
DH>     SELECT title FROM booklist WHERE MATCH(title) AGAINST('+"august 2002*" IN 
BOOLEAN MODE);
 
DH> the result set excludes rows where "august 2002" happens to appear at the very end 
of the "title" column. Alternatively, when you put the asterisk outside the quotes, as 
in
 
DH>     SELECT title FROM booklist WHERE MATCH(title) AGAINST('+"august 2002"* IN 
BOOLEAN MODE);
 
DH> the result set includes rows where the "title" column includes "august 2002" OR 
"august 2001" OR "august 2000".
 
DH> Leaving out the asterisk restricts the result set to non-generic matches. For 
example '+"modern japan'" will match "Modern Japan" but NOT "Modern Japanese". None of 
these three result sets is
DH> acceptible for our application.
 
DH> Does anyone know how to use asterisks effectively in FULLTEXT phrase searching?
 
DH> [NOTE: For security reasons I can't release a script that would allow access to 
our database, but I'll be glad to answer any and all questions that will help resolve 
this issue. I'm posting this
DH> question a second time because I don't think it worked the first.] 

Can you provide repeatable test case?
I tested full-text search on "august 2002" and it worked fine

mysql> select * from testcase where match(title) against('"august 2002"' in boolean 
mode);
+----+---------------------+
| id | title               |
+----+---------------------+
|  2 | aaa august 2002 bbb |
|  5 | aaa bbb august 2002 |
+----+---------------------+
2 rows in set (0.00 sec)

mysql> select * from testcase where match(title) against('"august 2002*"' in boolean 
mode);
+----+---------------------+
| id | title               |
+----+---------------------+
|  2 | aaa august 2002 bbb |
|  5 | aaa bbb august 2002 |
+----+---------------------+
2 rows in set (0.00 sec)

mysql> select * from testcase where match(title) against('"august 2002"*' in boolean 
mode);
+----+---------------------+
| id | title               |
+----+---------------------+
|  2 | aaa august 2002 bbb |
|  5 | aaa bbb august 2002 |
+----+---------------------+
2 rows in set (0.01 sec)

So, no rows with "august 2001" were not find.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to