When computing the similarity between a query and a document one should be document centric instead of query centric in order to take advantage of the sparsity (0 weight) of terms in a document.
Analogy: Index at the end of a textbook.
Solution: Inverted Index
--Shaunak