Jump to content


Photo

FULLTEXT index problem


  • Please log in to reply
2 replies to this topic

#1 Horst Azeglio

Horst Azeglio
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 11 June 2006 - 10:34 PM

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

#2 Wildbug

Wildbug
  • Members
  • PipPipPip
  • Advanced Member
  • 1,149 posts

Posted 12 June 2006 - 02:19 PM

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 the particular dataset in which they occur. 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 non-FULLTEXT indicies, i.e., INDEX (lastname,firstname) can be searched on (lastname,firstname) or (lastname) but not (firstname).
Twice a day my clock works PERFECTLY!  I can't figure out what's wrong with it.

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 12 June 2006 - 04:56 PM

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.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users