mysql order by best match and search with whitespace

Viewed 29

I am writing an inquiry because I have a question while using mysql.

I use like , not match against.

Because the size of the index increases for a one-character search, and when the search keyword is long, it becomes slower than the like search.

Q1. I know that using '%%' doesn't use index. So is the best way to use REPLACE(name,' ','') like '%searchKeyword%' for whitespace search?

If there is another good way, please suggest.

Q2. I want to output the result with the most similar word first after searching like.

If you search for ed, I want ed sh to be output first, Ed Sheeran and asd ed to be output.

I wonder what would be the best way.

My questions have many similarities, but they are not clearly resolved. Many good answers please! thank you!

0 Answers
Related