MySQL FULLTEXT

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
chonkster
Forum Newbie
Posts: 1
Joined: Sat Sep 01, 2007 7:30 pm

MySQL FULLTEXT

Post by chonkster »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


've been racking my brain all day on this. I've done some searching and have tried a few different things from the forums that don't work. Here's my issue.

I create a table:
[syntax="sql"]
CREATE TABLE `Builders` (
`ID` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
`Name` TEXT,
`BizName` TEXT,
FULLTEXT (Name,BizName)
) TYPE = MYISAM ;
Populate it with some data:

Code: Select all

INSERT INTO Builders (Name,BizName) VALUES ('Jeffrey Yonker','Chonk Digital Design');
When I query using

Code: Select all

SELECT * FROM Builders WHERE MATCH (Name,BizName) AGAINST ('Jeffrey');
I get the first table row returned.

However when I query using

Code: Select all

SELECT * FROM Builders WHERE MATCH (Name,BizName) AGAINST ('Joe');
I STILL get the first table row returned;

Now if I add another column to the table:

Code: Select all

INSERT INTO Builders (Name,BizName) VALUES ('Joeseph Bowers','Bowers Construction');
so that there are now 2 entries in the table and I query using

Code: Select all

SELECT * FROM Builders WHERE MATCH (Name,BizName) AGAINST ('Jeffrey');
I get an empty set.

Any ideas anyone? Thanks in advance.

Chonk


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
playgames
Forum Newbie
Posts: 22
Joined: Tue Sep 04, 2007 4:28 am

Post by playgames »

FULLTEXT:

if keyword's precent that in all the fulltext field >50%.

MYSQL will drop it.
mwasif
Forum Newbie
Posts: 13
Joined: Sun Jul 15, 2007 1:24 pm

Post by mwasif »

Checkout the FULLTEXT in detail at http://dev.mysql.com/doc/refman/5.0/en/ ... earch.html. The words less than 4 characters are ignored in search, to change this behaviour change the value for ft_min_word_len in my.ini/my.cnf.
Post Reply