I'm running a query that looks something like this:
SELECT * FROM `table` WHERE `field` LIKE '%567%' LIMIT 6;
As is apparent, this isn't quite the most efficient way to do this since the method isn't sargable and doesn't honor the indexing on the searched field. The inefficiency is an even bigger concern in my context since I anticipate the said table to grow indefinitely (read millions of records). I tried the below as advised by a few websites but it refuses to perform the search as expected:
SELECT * FROM `table` WHERE CONTAINS(`field`, '567') LIMIT 6;
This option only returns when it hits an "exact" match which isn't what I'm looking for.
The following seems to have the same effect:
SELECT * FROM `table` WHERE MATCH (`field`) AGAINST ('567' IN BOOLEAN MODE);
Is there ANY way to make the partial search sargable in MySQL?