How to implement autocomplete on a massive dataset

前端 未结 7 843
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 21:54

I\'m trying to implement something like Google suggest on a website I am building and am curious how to go about doing in on a very large dataset. Sure if you\'ve got 1000 items

7条回答
  •  一生所求
    2021-01-29 22:21

    Not algorithmically related to what you are asking, but make sure you have a 200ms or more delay (lag) after the kaypress(es) so you ensure that the user has stopped typing before issuing the asynchronous request. That way you will reduce redundant http requests to the server.

提交回复
热议问题