I am referring to the algorithm that is used to give query suggestions when a user types a search term in Google.
I am mainly interested in: 1. Most important resul
If you are looking for an overall design for the problem, try reading the content at https://www.interviewbit.com/problems/search-typeahead/.
They start by building autocomplete through a naive approach of using a trie and then build upon it. They also explain optimization techniques like sampling and offline updates to cater to specific use cases.
To keep the solution scalable, you would have to shard your trie data intelligently.