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

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jack_indigo
Forum Contributor
Posts: 186
Joined: Sun Jun 08, 2008 11:25 pm

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

Post 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?
marcth
Forum Contributor
Posts: 142
Joined: Mon Aug 25, 2008 8:16 am

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

Post by marcth »

jack_indigo
Forum Contributor
Posts: 186
Joined: Sun Jun 08, 2008 11:25 pm

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

Post by jack_indigo »

Databases
Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Post Reply