When using php to develop a website, where is the search box? When inputting, the user input method is not switched properly. There may be situations where the input is pinyin. So how to convert pinyin to Chinese characters and query the database to display the corresponding products! I originally wanted to use sphinx, but I had no choice but to install it for several days without success!
This requires using a search engine, the database is too heavy
This is word association, which cannot be achieved without a huge local vocabulary library. It is recommended to use a third-party API
Use third-party search support
elasticsearch
,xunsearch
,sphinx
and other processingIn fact, you can add a pinyin field to the product, which will make the search better
This is word association, which cannot be achieved without a huge local vocabulary library. It is recommended to use a third-party API
Pinyin to Chinese character conversion solution https://github.com/letiantian...
If there are not many products, you can also add an extra pinyin field