问题
I am working with MySQL full text search but find it lacking in situations where your string is part of a word within a field. If my field is "New York Times" and I search for "Time" I get no results. The hackish way to solve this is to set up two queries, one that does a full text search and the other that does:
SELECT * FROM ___ WHERE 'string' LIKE %searchterm%
Is there any way that I can set up my full text search to solve this issue so I don't have to run the extra query?
回答1:
I've basically given up on MySql's full text search in favor of Sphinx -- a dedicated full-text search engine which implements MySql's network protocol so you can "interpose" it between your clients and a MySql server, losing nothing and gaining rich, serious full-text capabilities. Maybe it's not suitable for your needs (which you don't fully express), but I think it's at least work checking out!
回答2:
You can use wild cards in your full text search. More info here
SELECT * FROM _____ WHERE MATCH (title) AGAINST ('time*' IN BOOLEAN MODE);
来源:https://stackoverflow.com/questions/1437066/mysql-fulltext-search-and-like