Page 1 of 1

MySQL FULLTEXT

Posted: Sat Sep 01, 2007 7:32 pm
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]

Posted: Wed Sep 05, 2007 9:51 pm
by playgames
FULLTEXT:

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

MYSQL will drop it.

Posted: Thu Sep 06, 2007 12:26 pm
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.