A method of providing search results to a user, comprising: receiving a request for a search query, the request comprising a maximum number of documents to be displayed on a first results page; identifying documents in a search index that contain the keywords in the user query; calculating a number of documents to be retrieved, the number of documents to be retrieved being 50% more documents than the maximum number of documents than can be displayed on the first result page; retrieving the number of documents relevant to the search query, listed in the search index; determining, in a security trimming process, access rights corresponding to the plurality of retrieved documents; the security trimming process comprising: setting the first document in the retrieved results as the current result and determining whether the user is authorized to view the current result; if the user is not authorized to view the current result, removing the current result from a list of authorized results to be displayed to the user; determining whether the current result is the last result in the retrieved results, and, if it is determined that the current result is not the last result, setting the next document of the retrieved results as the current result; maintaining session state information, the session state information comprising a first value representing a number of documents for which a user is determined to have access rights and a second value representing a number of documents for which the access rights have been scanned in order to arrive at the first value; retrieving, if it is determined that the current result is the last result of the retrieved results a number of additional documents relevant to the search query, the number of additional documents determined from the session state information; until the security trimming process results in the maximum number of documents to be displayed on the first results page and instructing a client computer to display the documents, for which the user is determined to have access rights, on the first results page. receiving a request for a search query, the request comprising a maximum number of documents to be displayed on a first results page; identifying documents in a search index that contain the keywords in the user query; calculating a number of documents to be retrieved, the number of documents to be retrieved being 50% more documents than the maximum number of documents than can be displayed on the first result page; retrieving the number of documents relevant to the search query, listed in the search index; determining, in a security trimming process, access rights corresponding to the plurality of retrieved documents; the security trimming process comprising: setting the first document in the retrieved results as the current result and determining whether the user is authorized to view the current result; if the user is not authorized to view the current result, removing the current result from a list of authorized results to be displayed to the user; determining whether the current result is the last result in the retrieved results, and, if it is determined that the current result is not the last result, setting the next document of the retrieved results as the current result; maintaining session state information, the session state information comprising a first value representing a number of documents for which a user is determined to have access rights and a second value representing a number of documents for which the access rights have been scanned in order to arrive at the first value; retrieving, if it is determined that the current result is the last result of the retrieved results a number of additional documents relevant to the search query, the number of additional documents determined from the session state information; until the security trimming process results in the maximum number of documents to be displayed on the first results page and instructing a client computer to display the documents, for which the user is determined to have access rights, on the first results page. setting the first document in the retrieved results as the current result and determining whether the user is authorized to view the current result; if the user is not authorized to view the current result, removing the current result from a list of authorized results to be displayed to the user; determining whether the current result is the last result in the retrieved results, and, if it is determined that the current result is not the last result, setting the next document of the retrieved results as the current result; maintaining session state information, the session state information comprising a first value representing a number of documents for which a user is determined to have access rights and a second value representing a number of documents for which the access rights have been scanned in order to arrive at the first value; retrieving, if it is determined that the current result is the last result of the retrieved results a number of additional documents relevant to the search query, the number of additional documents determined from the session state information; until the security trimming process results in the maximum number of documents to be displayed on the first results page and instructing a client computer to display the documents, for which the user is determined to have access rights, on the first results page.