create fulltext index mysql code example
Example 1: create fulltext index mysql
-- examble to create fulltext index on posts table on blog
CREATE FULLTEXT INDEX IF NOT EXISTS idx_title_body ON
posts(title, body);
SELECT
*
FROM
posts
WHERE
MATCH(title, body) AGAINST("search words" IN BOOLEAN MODE);
Example 2: create fulltext index mysql
CREATE FULLTEXT INDEX IF NOT EXISTS idx_col1_col2 ON
tableName(col1, col2);
SELECT
*
FROM
tableName
WHERE
MATCH(col1, col2) AGAINST("search words");