I got a table of product which I would like to search for a product in there. At the momment, the query looks like this:
$query = "SELECT * FROM `products` WHERE `name` LIKE '%$qr_search%' LIMIT 0,$products_per_single_search";
As you can see, im using the %SOME_TEXT% method, which is nice, but not good enough.
If the user searches for pen he would get results such as:
- pen
- peny
- pentra
- somewordPENword
and so on. I'm not saying that it's irrelevant to have those results, but I would like to make some order in there, so the most relevant results will show first.
Is there any better mechanism for that?