SELECT `id`, `name`, `frontCover`, `type`, `category`, `user`, `author`, `MRP`, `sellingPrice`, `isNew`, `isRaw`, `binding`, `publisherName`, `publicationYear`, (MATCH name,author AGAINST ("made easy editorial board" IN BOOLEAN MODE)) AS relevance FROM `books` WHERE LOWER(type) = 'college' AND (MATCH name,author AGAINST ('made easy editorial board' IN BOOLEAN MODE)) AND `status` = 1 ORDER BY `relevance` DESC
当尝试运行查询时,它给我错误
#1191 - Can't find FULLTEXT index matching the column list
我添加了姓名和作者全文索引。 但是当我运行单列时,它可以工作。我需要从两列匹配结果中获取。
答案 0 :(得分:1)
在查询中使用两列时,两列都需要组合的FULLTEXT索引。
ALTER TABLE `books`
ADD FULLTEXT INDEX `IDX_FULLTEXT_NAME_AUTHOR` (`name` ASC, `author` ASC);