I'm trying to implement a feature that would list the 10 most recent
searches and the 10 most popular search terms (weighted by the number
of times the same term has been searched). Not sure how I can best
approach this, any help would be really appreciated.