A relatively simple solution for this would be to include the FULLTEXT index in these two fields and subsequently search using that index.
ALTER TABLE table ADD FULLTEXT(title, description);
Then you need to do a search, you would do the following:
SELECT id FROM table WHERE MATCH (title, description) AGAINST ('keyterm');
Full-text indexed search is an automated solution included in most SQL databases. This is much faster compared to running LIKES. It is also optimized for your specific case, because you are only interested in natural language search terms.
In addition, the full-text index has some restrictive algorithm for determining relevance. You can read about it here.
EDIT
In the alter instruction, I skipped the full name of the index, it should be:
ALTER TABLE table ADD FULLTEXT ft_index_name(title, description);
gtr32x
source share