Category: PHP, MySQL

You have a MySQL database with one ore more columns of type TEXT containing arbitrary free text. You have many rows and a lot of text in each column and you experience very poor performance when using LIKE statements to perform a full text search: A faster way to perform a full text search is the MATCH AGAINST statement: Note the “‘\“” that is wrapped around the search phrase. This is important to make sure you are searching for that exact phrase and not the individual words it contains. For MATCH AGAINST to perform well you need to create a full text index on the column you want to search: If your MySQL version is below 5.6, you have to change the engine to MyISAM. Make sure MyISAM works for you: You can also create a separate table with engine MyISAM only for Fulltext searching purposes.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners