Can't assign FULLTEXT index on my table

房东的猫 提交于 2019-12-11 08:42:55

问题


I am trying to implement a search function on a database table using query expansion, and I'm aware that I have to add the FULLTEXT index on the fields I want to become searchable. I have tried to do this and got no errors from PHPMyAdmin, but when I examine the structure of the table the cardinality of the FULLTEXT index is 0. I have tried inidividually setting the FULLTEXT index and it seems to work, but my serach returns the error: Can't find FULLTEXT index matching the column list

Any ideas what's going wrong?


回答1:


Try executing a REPAIR on the table you have just added them to, to (re)build the fulltext indexes:

REPAIR table foo

Also note that fulltext will only work on varchar or text columns. As a last resort, I would try restarting MySql.

The following page just about covers everything:

http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html

Hope that helped.




回答2:


I had to add the index on all fields i wanted to be searchable and in the combination I wanted to search them...




回答3:


Check your database storage engine. InnoDB do not support FULLTEXT index. Change it to MyISAM



来源:https://stackoverflow.com/questions/1328897/cant-assign-fulltext-index-on-my-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!