I have a slight challenge with data that I need to get solved. I have a table where the plain text of emails is stored in a longtext column. It was like this before I started developing in the framework. There are over a million rows already with large emails stored in them.
I need to be able to search for text in that field but it takes ages before any results are returned. This is not ideal because there are hundreds of users using the system and they need the ability to search email content.
I have tried the following simple SQL statement but it takes too long to find records:
select id from emails where description like "%hello world%";
According the the MySQL documentation, full-text indexing can only be used in char, varchar and text fields.
Can anyone suggest an efficient way to search in a longtext column?
or
Are there any SQL methods / commands that can be used to run through the table and splitting the longtext field's content into multiple text columns for full-text indexing?