I am running a simple mysql text query that searches for users on my site based on their "display name". Example request below - in this example we are looking for a "Lancaster toy store":
SELECT MATCH(`display_name`) AGAINST ('lancaster toy store') as `rel`
WHERE MATCH(`display_name`) AGAINST ('lancaster toy store')
ORDER BY `rel` DESC
It works well in that it is gaining good results, but an example of the results would be:
- toy store Charlotte
- toy store on the Broadway
- toy stores in Arizona.
- lancaster toy store
- toys on the east coast
As you can see, my problem is that people are looking for a βLancaster toy store,β and the obvious best result is near the middle or bottom.
I also use the porter-stem technique.
Any ideas on how to get more accurate results?
UPDATE
( - " " ):
SELECT `id`,
MATCH (`display_name`) AGAINST ('lancast* restor*' IN BOOLEAN MODE)
AS `RELEVANCY`
FROM `users`
WHERE `status` = 'active'
&& MATCH (`display_name`) AGAINST ('lancast* restor*' IN BOOLEAN MODE)
ORDER BY `RELEVANCY` DESC
LIMIT 25
:
- -
- ReStore 15 NH
- Morris Habitat ReStore
- Habitat ReStore Lima Ohio
- Charlotte ReStore
- ReStore Montgomery County
- ReStore
- ReStore
- ReStore