TF-IDF is a feature extracted from the data, much like a simple count of words, but it is not learned. It is simply computed. An example of learned features are word embeddings where it is necessary to train on data to obtain them.
If you want to apply machine learning to search then you need clickstream data, embeddings, or learned feature weights.