I am writing a custom file disposition solution for SharePoint 2013. After delete action (see below Delete_Action method), I saw that the selected file is removed.

After Full-Crawls or Incremental Crawls, the delete item is still showing on search result. But, once I click it,

"page not found"

is showing. It means that the item was deleted by me. But, Crawls still catch this deleted item for search result. It suppose not to show any deleted item on search result.

Could you give me any advice or solution?

    protected void Delete_Action(string url)
    Meetings/Sharepoint 2007 For the Power User.pdf ";

        using (SPSite site = new SPSite(url))
            using (SPWeb web = site.OpenWeb())
                SPFile file = web.GetFile(url);
                // file.Delete();
                SPListItem item = file.Item;

1 Answer 1


Search uses Delete policy for access denied or file not found

When the crawler encounters an access denied or a file not found error, the item is deleted from the index if the error was encountered in more than ErrorDeleteCountAllowed consecutive crawls AND the duration since the first error is greater than ErrorDeleteIntervalAllowed hours. If both conditions are not met, the item is retried.

So using PowerShell check the values of ErrorDeleteCountAllowed and ErrorDeleteIntervalAllowed

And updating it using

$SearchApplication = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"
$SearchApplication.SetProperty("ErrorDeleteCountAllowed", 1)


Deleted item still showing up in search results if only doing Incremental Crawls

  • ErrorDeleteCountAlloed,1 means "1" hour. default is 30hour based one MS white paper. So, I did full crawls yesterday and can see the right search result after 30 hours later what if i did not change any search setting using powershell?
    – chil
    Apr 28, 2015 at 12:53
  • See the above code, file.Delete() and Item.Delete(). I commented it out file.Delete(). Because of that, Crawl is still catching the delete file?
    – chil
    Apr 28, 2015 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.