indexer: Compute tf-idf

Compute the weights based on the tf-idf formula.