Create a new field to store the string after removing the special characters that need to be ignored, such as: sfsdf41bbsdfsd. When querying, perform the same operation on the keywords and use the new field to match
I think we should first process the data submitted by the user, divide the data submitted by the user with space dividing lines, form an array, and then use the data in this array to perform fuzzy query, and then retrieve the same data. . . But when a large number of users query in this way, I think your system will be slowed down very slowly, so it is not recommended to use this design pattern
The title question is set to word segmentation search. Direct fuzzy search cannot match the results. Using regular expression search is too inefficient and is not recommended. Moreover, there are too many scenarios. If you develop and implement it yourself, it will be difficult to consider them all. . It is recommended to use a search engine. Sphinx is very easy to use and supports mysql very well. The subject of the question has a php tag. If you often use php development, Xunsearch is also good, http://www.xunsearch .com/ Developed by Chinese, the documents are all in Chinese and very convenient to use.
What you need is not mysql fuzzy search.
Requires search engine support.
Create a new field to store the string after removing the special characters that need to be ignored, such as: sfsdf41bbsdfsd. When querying, perform the same operation on the keywords and use the new field to match
MySQL supports regular expression search, such as
SELECT name FROM person_tbl WHERE name REGEXP '^[aeiou]|ok$';
I think we should first process the data submitted by the user, divide the data submitted by the user with space dividing lines, form an array, and then use the data in this array to perform fuzzy query, and then retrieve the same data. . . But when a large number of users query in this way, I think your system will be slowed down very slowly, so it is not recommended to use this design pattern
The title question is set to word segmentation search. Direct fuzzy search cannot match the results. Using regular expression search is too inefficient and is not recommended. Moreover, there are too many scenarios. If you develop and implement it yourself, it will be difficult to consider them all. .
It is recommended to use a search engine. Sphinx is very easy to use and supports mysql very well.
The subject of the question has a php tag. If you often use php development, Xunsearch is also good, http://www.xunsearch .com/ Developed by Chinese, the documents are all in Chinese and very convenient to use.
Use a search engine, this is what they do professionally