Jacob Phan
Jacob Phan

Reputation: 732

Mysql fulltext index in multicolumn & "AND operator"

I have a table match'(id, white, black, event). I would like to find all rows which has "first" word in column white, "second" word in column black and "third" word in column event.

I can do this easy by "like" operator as following:

SELECT * 
FROM `match` 
WHERE 
  white like '%first%' 
  AND black like '%second%' 
  AND event like '%third%'

However my table contains about 10 million rows. How can I apply fullindex search?

Upvotes: 0

Views: 100

Answers (1)

Popa
Popa

Reputation: 11

Just make sure you have the table created with the default engine as myisam and do a alter table table_name add fulltext (column)

Upvotes: 1

Related Questions