Page 1 of 1

problem with this error message

Posted: Sat Jun 05, 2010 4:54 pm
by barrowvian
When I try to use my search function I get this error message;

Code: Select all

Problem with the query: SELECT *, MATCH(company_name, search_data) AGAINST('%00000001%') AS score FROM adverts WHERE MATCH(company_name, search_data) AGAINST('%00000001%') LIMIT 1, 500
Can't find FULLTEXT index matching the column list
Im not sure what the problem is though as I have made sure that the db table is FULLTEXT etc. Please could someone help me out.

Re: problem with this error message

Posted: Sat Jun 05, 2010 5:23 pm
by requinix
Your table needs a FULLTEXT index on both of those columns. Having one on each individually does not count. Ask whoever maintains your database to add one.

However it looks like you just want a regular LIKE search...

Re: problem with this error message

Posted: Sat Jun 05, 2010 5:45 pm
by barrowvian
i found this code to alter the table;

Code: Select all

ALTER TABLE adverts ADD FULLTEXT (company_name,,search_data)
Its still not working though :/ is there any other way that i can change it myself?

Re: problem with this error message

Posted: Sat Jun 05, 2010 5:55 pm
by barrowvian
nevermind, i just dropped the database and started from scratch :)

CREATE TABLE adverts
(
id INT(255) NOT NULL AUTO_INCREMENT,
company_name varchar(255) NOT NULL,
company_link varchar(255) NOT NULL,
contact_name varchar(255) NOT NULL,
contact_email varchar(255) NOT NULL,
image_link varchar(255) NOT NULL,
search_data varchar(255) NOT NULL,
PRIMARY KEY (id),
FULLTEXT(company_name, search_data)
);

worked this time