Home  >  Q&A  >  body text

java - @功能 提示一般如何实现?

现在各种地方都有@功能,典型的qq空间。 一般输入中文或者拼音 ,都可以提示出名字,而且不是首字符,中间的字符也可以。 而且速度都很快,一般都是100ms以内,就提示。这个是如何实现的?

天蓬老师天蓬老师2720 days ago398

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-04-18 10:34:13

    https://github.com/algolia/au...
    The basic function is to complete it automatically. You can check out the plug-in in the link, it may be helpful. The key is how you provide an automatically completed list of alternative data...

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-18 10:34:13

    What I am talking about is the prompt of @, not the analysis of @
    Simply put, if there is a personal name Wang hello, you enter ll, e, wang, Wang, an. . . . It can prompt the name Wang hello.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:34:13

    In fact, the principle is the same, but if your data volume is relatively large, it is not recommended to implement it directly based on the database. The like query performance is really not complimentary for large data volumes. It is recommended to introduce Lucene and spell out the name (name) and name (namePY) Index, and then implement a retrieval interface. After entering the @ symbol, just perform Suggest+ajax calling interface based on user input.

    reply
    0
  • Cancelreply