I found a tutorial
here that may help to start something like this.
ubbt_SEARCH_RESULTS would have to be altered (or a new table created) to save all the SEARCH_WORDS indefinitely, keeping track of how often each word/phrase has been typed in.
P.S. I never actually browsed that table before, and discovered 3 instances of SPAM in there! Unbelievable...! So things like this would need to be accounted for/prevented first...;)
This conversation probably belongs on ubbDev