Currently, I am implementing an API for autocomplete search similar to Google. My current approach involves having a JSON file that contains all the product names in a store. I insert this data into a trie and perform searches on the trie.
However, there is an issue: the product names list can change at any time. If I use the data from the JSON file for searching, the results might be outdated compared to the actual database.
I am not sure what I should do to ensure that the search results are always up-to-date with the latest data from the database.
I would appreciate any help or advice from the community on how to solve this problem.
Thank you!
Minh Quang Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.