I have a field, called 'message' and it can hold a string of up to 500 characters in length. It's basically for an in-site inbox system.
A user has a capacity of 250 messages in their inbox.
If a user wanted to search their inbox for messages with the string 'men fashion', I would want the MySQL query to limit the query down to the 250 messages associated to that user before even searching through the 'message' field.
I would want the query to also determine and return the query results in order of how well the search string matches the content of the message. So a message that had 'men's fashion' appear thrice would appear on top; one that had 'fashion' would appear next and one that had 'men' would appear at the bottom.
How do you:
You could take a look at MySql Full Text Search function. It could return search results by relevancy.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.