The default SharePoint behavior is to also search documents which have been deleted unless the content has been re-crawled or index is reset. I am using a KeywordQuery to search items with a particular managed property and I don't want the deleted items to show up in the result even if content has not been re-crawled or reset.

    query.QueryText = string.Format("Barcode:\"{0}\"", "ABC123");
    query.ResultTypes |= ResultType.RelevantResults;

The only way I am able to achieve it so far is to add the "Path" property and then checking if the resulting SPListItem is not null.


Is there any better way of doing this?

1 Answer 1


If you have a high ratio of queries compared to deletes, then you might want to add an event receiver which calls CrawlRuleCollection.RemoveFromResults upon deletion of an item

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.