https://stats.stackexchange.com/questions/121675/how-do-search-engines-generate-related-searches
From what I gather, there has to be some sort of a ranking algorithm where the words which the user enters first get bagged, and then the closest related search pops up, from a his