Forum Moderators: open

Message Too Old, No Replies

Problems using MATCH

Using match and fulltext problems

         

salewit

5:34 pm on Mar 31, 2007 (gmt 0)

10+ Year Member



I'm trying to use MATCH in my database, but I keep getting errors.

When I do:

SELECT * FROM inventory WHERE match(description) AGAINST('search phrase');

There's no problem. When I do:

SELECT * FROM inventory WHERE match(header) AGAINST('search phrase');

There's no problem. But when I try to use both columns:

SELECT * FROM inventory WHERE match(header,description) AGAINST('search phrase');

I get "#1191 - Can't find FULLTEXT index matching the column list"

Both columns have FULLTEXT indexes. MySQL docs show the syntax as: MATCH (col1,col2,...) AGAINST (expr [search_modifier])

Totally stumped.

physics

2:37 am on Apr 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try creating a FULLTEXT index on BOTH of the fields TOGETHER, not separately. So, for example:

ALTER TABLE inventory ADD FULLTEXT head_desc (header,description);

salewit

2:21 am on Apr 4, 2007 (gmt 0)

10+ Year Member



That was it! Thanks very much. I didn't find any documentation anywhere that specified having to do it like that, but it works great.