Listen to the onkeyup event, send an Ajax request to the background, pass the entered keywords to the background, perform fuzzy matching in the background, and return the array to the front end; Pay attention to two places here, the first is the onkeyup event of the front end, here is the function Throttling to prevent frequent requests to the background, portal: http://www.cnblogs.com/dolphinX/p/3403821.html; the second is database optimization, the searched fields need to be indexed and cached, here There are a lot of things involved, so you need to find relevant information by yourself; The last thing is about the front-end effect implementation. There are many jquery plug-ins. You can find them by searching Baidu’s automatic completion. Here are a few for you: http://jq22. com/search?seo=%E8%87%AA%E5%8A%A8%E8%A1%A5%E5%85%A8
Tell me a rough plan First record the words searched by the user. Each user search is recorded separately and stored in the database (you can filter here or import some words yourself) Convert Chinese to Pinyin before storing in the database and save it for fuzzy search Scheduled tasks update the number of records in the index for each search term (this may not be possible in real time) You can use some jquery plug-ins at the front desk, such as autocomplete in jquery-ui The actual effect can be seen at www.cnal.com Search
Implementing an intelligent prompt function requires a lot of knowledge such as ajax, database, jsp/php, algorithms, etc. If the amount of data is large, special optimization is required It is not cost-effective to spend too much effort on a small function I used 92find.c-o-m Search box smart prompt function hosting service, With just one line of javascript code, you can realize all the functions of Baidu and Taobao search box prompts For example: Chinese character pinyin matching, pinyin prefix matching, fuzzy search, intelligent fault tolerance, and you can also customize prompt vocabulary and its Sorting weight It only takes five minutes for my website to deploy an input prompt function that is as powerful and easy to use as Baidu and Taobao It is also compatible with IE, Firefox, Safari, Chrome, and Opera browsers It is compatible with ios, Android, and Windows
Implementing an intelligent prompt function requires a lot of knowledge such as ajax, database, jsp/php, algorithms, etc. If the amount of data is large, special optimization is required It is not cost-effective to spend too much effort on a small function I used 92find.c-o-m Search box smart prompt function hosting service, With just one line of javascript code, you can realize all the functions of Baidu and Taobao search box prompts For example: Chinese character pinyin matching, pinyin prefix matching, fuzzy search, intelligent fault tolerance, and you can also customize prompt vocabulary and its Sorting weight It only takes five minutes for my website to deploy an input prompt function that is as powerful and easy to use as Baidu and Taobao It is also compatible with IE, Firefox, Safari, Chrome, and Opera browsers It is compatible with ios, Android, and Windows
Listen to the onkeyup event, send an Ajax request to the background, pass the entered keywords to the background, perform fuzzy matching in the background, and return the array to the front end;
Pay attention to two places here, the first is the onkeyup event of the front end, here is the function Throttling to prevent frequent requests to the background, portal: http://www.cnblogs.com/dolphinX/p/3403821.html; the second is database optimization, the searched fields need to be indexed and cached, here There are a lot of things involved, so you need to find relevant information by yourself;
The last thing is about the front-end effect implementation. There are many jquery plug-ins. You can find them by searching Baidu’s automatic completion. Here are a few for you: http://jq22. com/search?seo=%E8%87%AA%E5%8A%A8%E8%A1%A5%E5%85%A8
angular can be automatically bound
Tell me a rough plan
First record the words searched by the user. Each user search is recorded separately and stored in the database (you can filter here or import some words yourself)
Convert Chinese to Pinyin before storing in the database and save it for fuzzy search
Scheduled tasks update the number of records in the index for each search term (this may not be possible in real time)
You can use some jquery plug-ins at the front desk, such as autocomplete in jquery-ui
The actual effect can be seen at www.cnal.com Search
There is a jq.autocomplete plug-in. You can take a look at the source code and then develop it again.
Implementing an intelligent prompt function requires a lot of knowledge such as ajax, database, jsp/php, algorithms, etc.
If the amount of data is large, special optimization is required
It is not cost-effective to spend too much effort on a small function
I used 92find.c-o-m Search box smart prompt function hosting service,
With just one line of javascript code, you can realize all the functions of Baidu and Taobao search box prompts
For example: Chinese character pinyin matching, pinyin prefix matching, fuzzy search, intelligent fault tolerance, and you can also customize prompt vocabulary and its Sorting weight
It only takes five minutes for my website to deploy an input prompt function that is as powerful and easy to use as Baidu and Taobao
It is also compatible with IE, Firefox, Safari, Chrome, and Opera browsers
It is compatible with ios, Android, and Windows
Implementing an intelligent prompt function requires a lot of knowledge such as ajax, database, jsp/php, algorithms, etc.
If the amount of data is large, special optimization is required
It is not cost-effective to spend too much effort on a small function
I used 92find.c-o-m Search box smart prompt function hosting service,
With just one line of javascript code, you can realize all the functions of Baidu and Taobao search box prompts
For example: Chinese character pinyin matching, pinyin prefix matching, fuzzy search, intelligent fault tolerance, and you can also customize prompt vocabulary and its Sorting weight
It only takes five minutes for my website to deploy an input prompt function that is as powerful and easy to use as Baidu and Taobao
It is also compatible with IE, Firefox, Safari, Chrome, and Opera browsers
It is compatible with ios, Android, and Windows