Devendra Chauhan
Devendra Chauhan

Reputation: 2767

full text searching not working in multiple colomn

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

when trying to run query it gives me error

#1191 - Can't find FULLTEXT index matching the column list

I have added name and author full text Indexes. but when i run single column it works. i need to get from two column matching result.

Upvotes: 0

Views: 26

Answers (1)

skelwa
skelwa

Reputation: 585

You need a combined FULLTEXT index on both columns as you are using both columns in the query.

ALTER TABLE `books` 
ADD FULLTEXT INDEX `IDX_FULLTEXT_NAME_AUTHOR` (`name` ASC, `author` ASC);

Upvotes: 1

Related Questions