Given a query document vector q, we use the Cosine similarity measure to evaluate the similarity between q and a document x in a dataset: Then the traditional document retrieval method exhaustively scans all documents in the dataset and returns the most similar ones.
such a brute-force search does not scale to massive datasets since the search time complexity for each query is O(n); additionally, the computational cost spent on Cosine similarity calculation is also nontrivial.