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

How do you use a KeywordQuery to search for "last modified by" and "last modified date"?

This is for SharePoint 2010 Server, with publishing pages and document libraries, so "enterprise search". I'm currently using the query like so:

new KeywordQuery(SPContext.Current.Site)
    QueryText = "query",
    // ...
share|improve this question
up vote 1 down vote accepted

If you use a KeywordQuery, both of these are easily searched upon.

For "last modified by", you can simply add:

and Author:"domain\user" the Query. This will only return items who were last updated by domain\user.

For "last modified date", this is most easily filtered upon when the search results are already gathered, by using a RowFilter on a DataView made from the DataTable returned by the KeywordQuery:

dataView.RowFilter = "write <= '1989-12-24'";
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.