Recently I read a similar example on CS50 course, to do fast search. It is simply a json request everytime a keyboard event is activated. For storage, either store it in memory for instant lookup table or use redis.
https://cs50.harvard.edu/college/2018/fall/weeks/7/notes/
look for the example on WORDS