Help > Web Development > Object Reference > Object Reference > ISYSResultList > RemoveDocument Method
<a name="kanchor514"></a>ISYSResultList:RemoveDocument Method
Remove the specified document from the result list. This function can be used to implement your own security on the result list.

Syntax
[VBScript]
sub ISYSResultList.RemoveDocument(_
  long Index_ 
)
[C#]
void IISYSResultList.RemoveDocument(
  long Index
);
[ColdFusion/Java]
void IISYSResultList.RemoveDocument(
  long Index
) throws ComException;
Parameters
IndexThe index of the document you wish to remove. This may be between 1 and Length.

Examples
[VBScript]
<% ' This sample demonstrates removing documents from a result list dim Results, I ' Execute a pre-configured search Set Results = ISYSSearch.Execute I = 1 ' Loop over each document removing those that don't meet our criteria Do While I <= Results.Length if Not DoesUserHavePermssion(Results.Item(I).Filename) then Results.RemoveDocument I else I = I + 1 end if Loop %>
Remarks
It can be quite time consuming to enumerate of the entire result list, validating each document and removing unwanted one. To improve performance, it is recommended you do this action in batches.

In most web pages, search results are usually return in batches of 10 or so. You can take advantage of this by only validating up to the required amount. Therefore on the first page, you only validate until you have 10 validated documents. On the next page, you validate the next 10, and so on, and so on.