Page 1 of 1

Weird MySQL MATCH/AGAINST (Full-Text Search) Issue

Posted: Mon Aug 25, 2008 1:47 pm
by jack_indigo
I had this weird issue with MySQL MATCH/AGAINST syntax last night. I created the start of a mini-CMS with an articles table. I then did this:

Code: Select all

ALTER TABLE articles ADD FULLTEXT(title, content);
Title is a varchar. Content is a text.

The table is a MyISAM table on MySQL Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486).

So then I stuck "test" into some of the titles, and again in some of the contents.

I then did:

Code: Select all

SELECT * FROM articles WHERE MATCH (title, content) AGAINST ('test');
And guess what? I got zero results back. So then I switched it like so:

Code: Select all

SELECT * FROM articles WHERE MATCH (title, content) AGAINST ('test' IN BOOLEAN MODE);
And now results come back. Any idea why this occurs?

Re: Weird MySQL MATCH/AGAINST (Full-Text Search) Issue

Posted: Mon Aug 25, 2008 6:54 pm
by marcth

Re: Weird MySQL MATCH/AGAINST (Full-Text Search) Issue

Posted: Mon Aug 25, 2008 7:00 pm
by jack_indigo
Databases
Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.