Either you have your own search department to develop it yourself, or you use some of the popular open source search engines, such as solr and elasticsearch
Let me tell you my idea: convert Chinese characters into pinyin and then perform full-text search.
// PHP利用ICU扩展intl实现汉字转拼音
echo transliterator_transliterate('Any-Latin; Latin-ASCII; Lower()', '德克士'); //de ke shi
echo transliterator_transliterate('Any-Latin; Latin-ASCII; Lower()', '得克'); //de ke
// 假设name字段内容为"德克士",则name_fts字段内容为"de ke shi".
// MySQL全文检索字段name_fts中同时包含"得克"关键字de和ke的商店记录.
// 所以 name_fts 中包含de和ke的店铺都能显示出来.
SELECT name FROM store
WHERE MATCH(name_fts) AGAINST('+de +ke' IN BOOLEAN MODE)
ORDER BY id DESC LIMIT 5;
Doesn’t php have sphinx and xunsearch?
Try the elasticsearch search engine, which supports word segmentation, full-text search, and can also be sorted based on similarity
Either you have your own search department to develop it yourself, or you use some of the popular open source search engines, such as solr and elasticsearch
Let me tell you my idea: convert Chinese characters into pinyin and then perform full-text search.