FULLTEXT or LIKE?

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
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

FULLTEXT or LIKE?

Post by alex.barylski »

I have a small single keyword text field...

Should I use FULLTEXT on the field or LIKE? The reason I ask, is because, ideally I would like the RDBMS to handle synonyms and inflections (ie: runs, running, runner, etc).

I suppose LIKE would work, assuming someone entered 'run' as it could potentially match all above. However, what if someone typed 'runnings' and actually meant 'runner'.

Soundex support would also be neat...

I need ot build a fairly sophisticated keyword search for an application but I do not have the luxury of detailed profile TEXT fields, instead I have a few single keyword VARCHAR fields...

Whats says you?
anand
Forum Commoner
Posts: 80
Joined: Fri May 22, 2009 11:07 am
Location: India
Contact:

Re: FULLTEXT or LIKE?

Post by anand »

PCSpectra wrote:I have a small single keyword text field...

Should I use FULLTEXT on the field or LIKE? The reason I ask, is because, ideally I would like the RDBMS to handle synonyms and inflections (ie: runs, running, runner, etc).

I suppose LIKE would work, assuming someone entered 'run' as it could potentially match all above. However, what if someone typed 'runnings' and actually meant 'runner'.

Soundex support would also be neat...

I need ot build a fairly sophisticated keyword search for an application but I do not have the luxury of detailed profile TEXT fields, instead I have a few single keyword VARCHAR fields...

Whats says you?
LIKE.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: FULLTEXT or LIKE?

Post by Eran »

Sphinx (if you can) - http://www.sphinxsearch.com/
Bear in mind that if you use LIKE with wildcards at both sides it can't use an index (= slow)
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: FULLTEXT or LIKE?

Post by pickle »

LIKE doesn't handle synonyms & similar words. FULLTEXT does.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
rollydudez
Forum Newbie
Posts: 1
Joined: Wed Jun 17, 2009 10:31 pm

Re: FULLTEXT or LIKE?

Post by rollydudez »

pickle wrote:LIKE doesn't handle synonyms & similar words. FULLTEXT does.
YEAH i think there is no similarity :roll:


________________
where
Post Reply