Quantcast
Channel: Question and Answer » file
Viewing all articles
Browse latest Browse all 103

Deleted items are still showing on Search result after Full Crawls or incremental Crawls

$
0
0

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;
                item.Delete();
            }
        }
    }

Viewing all articles
Browse latest Browse all 103

Trending Articles