Jump to content


This topic is now archived and is closed to further replies.

Horst Azeglio

FULLTEXT index problem

Recommended Posts

I'm trying to do a MySQL Query but it doesn't work. (version 4.0.26)

When I put only one argument in MATCH, it shows no error but doesn't return anything

SELECT * FROM item WHERE MATCH (nom) against ('Huile');
SELECT * FROM item WHERE MATCH (nom_en) against ('Huile');

When I put two arguments:
SELECT * FROM item WHERE MATCH (nom,nom_en) against ('Huile');

It says: "Can't find FULLTEXT index matching the column list", but both nom and nom_en are FULLTEXT indexed.

Anyone can help? thank you

Share this post

Link to post
Share on other sites
From the MySQL manual on [a href=\"http://www.phpfreaks.com/mysqlmanual/page/manual_Functions.html#Fulltext_Restrictions\" target=\"_blank\"]full-text restrictions[/a]:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]"The MATCH() column list must exactly match the column list in some FULLTEXT index definition for the table, unless this MATCH() is IN BOOLEAN MODE."[/quote]
That's probably why you're getting the "Can't find FULLTEXT index matching the column list" error -- the two columns weren't defined together.
Also, if you're using small dataset to test your FULLTEXT searches, remember the following (also from the manual):
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]"A word that matches half of rows in a table is less likely to locate relevant documents. In fact, it will most likely find plenty of irrelevant documents. We all know this happens far too often when we are trying to find something on the Internet with a search engine. It is with this reasoning that rows containing the word are assigned a low semantic value for [i]the particular dataset in which they occur[/i]. A given word may exceed the 50% threshold in one dataset but not another.... The 50% threshold has a significant implication when you first try full-text searching to see how it works: If you create a table and insert only one or two rows of text into it, every word in the text occurs in at least 50% of the rows. As a result, no search returns any results. Be sure to insert at least three rows, and preferably many more."[/quote]
And then there's the possiblity that you don't have the word "Huile" in the dataset at all, but I assume you've checked that. As an aside, if I remember correctly columns in indicies can be used in the order they're defined for [b]non-FULLTEXT[/b] indicies, i.e., INDEX (lastname,firstname) can be searched on (lastname,firstname) or (lastname) but [i]not[/i] (firstname).

Share this post

Link to post
Share on other sites
That's right -- FULLTEXT searches produce very funny results on smaller recordsets. I've always found that this particular feature is very poorly implemented, and not really useful unless you have paragraphs upon paragraphs on english text in a given column. Otherwise, a custom index simply makes more sense.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.