Jump to content

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');
or
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
Link to comment
https://forums.phpfreaks.com/topic/11750-fulltext-index-problem/
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).
Link to comment
https://forums.phpfreaks.com/topic/11750-fulltext-index-problem/#findComment-44599
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.
Link to comment
https://forums.phpfreaks.com/topic/11750-fulltext-index-problem/#findComment-44658
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.