You need an order by
clause to order by relevance. You can put the MATCH
statement directly in the order by
:
SELECT index.*,
(CASE WHEN CHAR_LENGTH(index.product_description) > 32
THEN CONCAT(SUBSTRING(index.product_description, 1, 32), '...')
ELSE index.product_description
END) AS product_description, `product_title`,
(CASE WHEN CHAR_LENGTH(index.product_title) > 18
THEN CONCAT(SUBSTRING(index.product_title, 1, 18), '...')
ELSE index.product_title
END) AS product_title
from `index`
where MATCH (`product_title`) AGAINST (:search IN BOOLEAN MODE) and `category_name` = 'category1'
order by MATCH (`product_title`) AGAINST (:search IN BOOLEAN MODE) desc
LIMIT :start, :limit;