retrieving the documents for the term