MySQL gets blind!
| From: | Jo�o Verde | Date: | Thu, 14 Feb 2002 21:19:03 +0000 |
| Subject: | MySQL gets blind! | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-16968@lists.php.net to get a copy of this message | ||
Hi!
On a site I'm developing I need to conduct boolean searches. I use a
piece of code I found on:
http://www.evolt.org/article/comment/18/15665/
and I've got to say it works really well.
The problem is I cannot search for one specific word because, even
though the word exists on several records, MySQL never returns any
rows.
The word I can't look for is "portaria". Any other word works just
fine. I have tried every word I could think of and it works... except
for that one: "portaria".
Here is the syntax:
SELECT *, match (titulo,estado,sumario,categoria,tipo,pachave)
against (' portaria ') as relevance FROM dgf_net.dgf_lex WHERE match
(titulo,estado,sumario,categoria,tipo,pachave) against ('portaria')>0
HAVING relevance>0 ORDER BY relevance DESC
And here is a view of the table:
Field Type Attributes Null Default Extra
id int(11) No auto_increment
insdata datetime No 0000-00-00 00:00:00
startdata datetime No 0000-00-00 00:00:00
area tinytext No
autor varchar(255) No
titulo varchar(255) No
subtitulo varchar(255) No
texto text No
anexo tinytext No
pachave varchar(255) No
obs tinytext No
activo char(1) No N
validade datetime No 0000-00-00 00:00:00
imagem varchar(255) No
cafe varchar(8) No
Indexes :
Keyname Type Cardinality Field
PRIMARY PRIMARY 31 id
id INDEX None id
titulo FULLTEXT None titulo
subtitulo
texto 1
pachave
I'm puzzled! Why is MySQL picky about this specific word?
MySQL is 3.23.36 and PHP 4.0.4pl1
Any help is appreciated! :-)
jcv
:: cdb.pnorte.pt :: #26527125 ::
:: 02-14-2002 21:12:07 ::
:: A beer doesn't mind when your mother visits.