Autocomplete server-side implementation

后端 未结 10 679
感动是毒
感动是毒 2020-12-28 16:03

What is a fast and efficient way to implement the server-side component for an autocomplete feature in an html input box?

I am writing a service to autocomplete use

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-28 16:40

    Are there possible solutions that will let me scale better

    Yes, Oracle. This is kind of thing that databases are built for. Just index the relevant columns. If you are running against the wall of in-memory solutions, then the trade-off with disk seek time or network latency is probably moot. Especially if you insert a caching layer in between.

    Also, you may be able to decrease the number of hits if you tweak your client-side code a little. Such as setting a minimum number of type characters before a query is run or setting a fraction of a second of delay after the user stops typing. If you are already using those, set them a bit higher.

提交回复
热议问题