mysqljava
I am making an electronic dictionary and want to implement the input pre-completion function. For example, if you input win, words such as wind and window will appear. After looking at examples online, I still can’t do it. I hope the great god can give me some advice. The database is mysql. I am very grateful!
http://www.cnblogs.com/lovesqcc/p/4037708.html
This example is very good, I have practiced it myself.
Just comment out MapUtil.printMap(wordMatcher.obtainPrefixMatchers()); in the document and it will work. You can refer to the running results:
I personally think it can be like this: when you enter information in the text box, each time you enter a letter, it is equivalent to a click event. Use ajax to access the background, perform a fuzzy query on the database, and then display the returned data.
Personally, I think querying the database is not a good solution. It is relatively slow and the user inputs frequently, which results in more queries. Is it possible to adopt a caching strategy?