Reply to Re: why does MATCH/AGAINST fail to catch entries that LIKE does catch?

Your name:

Reply:


Posted by Erwin Moller on 06/19/07 08:39

lawrence k wrote:

>
> Wierd. Go to this page:
>
> http://www.ihanuman.com/search.php
>
> and search for "yoga"
>
> This query gets run:
>
> SELECT * FROM albums WHERE MATCH(name,description) AGAINST ('yoga')
> ORDER BY id DESC
>
> it returns nothing. (other searches work, but not the one for
> "yoga").
>
> But if I do SELECT * FROM albums WHERE description LIKE '%yoga%'
>
> then I get 5 matches
>
> What the hell??

Hi,

You are talking about MySQL I guess.
My knowledge of MySQL is limitted, but I think I can answer your question
based on TSEARCH2 as found in Postgresql.
Maybe it helps.

When you use 'match against' you are performing a full text search, which is
conceptually something different than LIKE '%yoga%'.

eg:
holayogatralala will match with: LIKE '%yoga%'
but not in match against.

FULL TEXT INDEXING is using whole words (or derivates) from a word.
This process is called 'stemming'.
eg: 'use' , 'used', and 'using' can all be stemmed to 'use'.
I *think* 'use' is called lexicon in this context, not 100% sure though..

Hope that helps.

Regards,
Erwin Moller

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация