我想做一个全文搜索,有两个组搜索查询,一个搜索匹配单词'Harry‘和'potter',第二个搜索查询只匹配单词'Rowling’。如何将它们和order dy date组合起来?然后是$query1 relevance is 70%,$query1 relevance is 30%?谢谢。
$query1 = "SELECT * FROM articles WHERE MATCH (title,content) AGAINST ('+Harry +potter' IN BOOLEAN MODE)";//all the articles both match word 'Harry' and 'potter'
$query2 = "SELECT * FROM articles WHERE MATCH (title,content) AGAINST ('+Rowling' IN BOOLEAN MODE)";//all the articles macth 'Rowling'发布于 2011-04-09 18:39:12
这两个查询都从相同的表和相同的列集中选择行。联合航空公司呢?
$query = "SELECT * FROM articles WHERE MATCH (title,content) AGAINST ('+Harry +potter' IN BOOLEAN MODE)
UNION
SELECT * FROM articles WHERE MATCH (title,content) AGAINST ('+Rowling' IN BOOLEAN MODE)";https://stackoverflow.com/questions/5603735
复制相似问题