In short, you need to use a Index time boosting to boost the value of a 'search queries index' - and periodically refresh it.
Lets you there is an index of all searched queries. That index can be created with an index time boost for each doc as a function of number of times searched. The boost factor could just be the number of times searched. https://wiki.apache.org/solr/SolrRelevancyFAQ#index-time_boosts
Eg. search queries - 'foo', 'foo', 'bar' , 'bar', 'bar' , 'abcd' will be added to a new index with 'foo' having a boost of 2,'bar' with 3, 'abcd' with 1.
You can do dynamic search on this index (starting with :) - and adding typed ahead characters to the query. The document score reflects the index time boost.
Eg. : will return docs with highest score first. After user types an 'f' - the term 'f*' returns 'foo' above others because of its higher index time boost.
I don't know 'terms component' behaves here. Its score is based on term frequency - not based on index time boost.
As you accumulate more search requests, you have to re-index with updated boost values that reflect the newer search counts.
Eg. if there is a new search for 'bar' - then you reindex 'bar' document with a boost of 4.