I am building a website that accepts user input keywords and output data that matches. For instance if the user specifies keyword as '`Restaurant pizza`' then my database should output such record.

My current table has a column called `category` and five columns named from `keyword1` to `keyword5` which contains their specialized area, i.e. 'pizza', 'chicken' or 'bbq' etc.

But I have no idea how to write the SQL query since user may input keywords in any order: category first or with specialized area first.

so such query will surely return no result (given that user input 'Restaurant pizza' for query):

```
SELECT * 
   FROM message 
 WHERE  category LIKE 'Restaurant pizza' 
 OR     keyword1 LIKE 'Restaurant pizza' 
 OR     keyword2 LIKE 'Restaurant pizza'

```

I guess it would be a bad idea splitting input keyword into words then running every word in the WHERE clause to database. but I really do not know how to achieve my goal.

In addition, would you please give me some advice on how to build index in this scenario?