SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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