Re: why does MATCH/AGAINST fail to catch entries that LIKE does catch?
- From: lawrence k <lkrubner@xxxxxxxxxxxxx>
- Date: Tue, 19 Jun 2007 12:00:36 -0700
On Jun 19, 4:34 am, Rik <luiheidsgoe...@xxxxxxxxxxx> wrote:
On Tue, 19 Jun 2007 09:08:18 +0200, lawrence k <lkrub...@xxxxxxxxxxxxx>
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
This clearly a MySQL issue, NOT PHP.
However, I think this might shed some light, from the manual:
The search result is empty because the word ?MySQL? is present in at least
50% of the rows. As such, it is effectively treated as a stopword. For
large datasets, this is the most desirable behavior: A natural language
query should not return every second row from a 1GB table. For small
datasets, it may be less desirable."
So, in short: 'yoga' might not be found as a separate word, or be
considered to 'common' to match. For more details, ask a MySQL-group.
Thanks very much. That is very helpful to me.
.
- References:
- Prev by Date: Re: PHP Blank Page.
- Next by Date: Re: avoid email sent by smtp to go in spam folder
- Previous by thread: Re: why does MATCH/AGAINST fail to catch entries that LIKE does catch?
- Next by thread: Re: why does MATCH/AGAINST fail to catch entries that LIKE does catch?
- Index(es):