For a such scenario the following approaches could be considered:
Override Query
[ToolboxItemAttribute(false)]
public class MyAggregatedDocuments : Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart
{
protected override void ConfigureDataSourceProperties()
{
// only perform actions when we are trying to show search results
// i.e. not when you're in Design Mode
if (this.ShowSearchResults)
{
// call the base web part method
base.ConfigureDataSourceProperties();
// get the data source object
CoreResultsDatasource dataSource = this.DataSource as CoreResultsDatasource;
// override the query being executed: Documents modified by current user
dataSource.Query = string.Format("IsDocument:1 AND Author:\"{0}\"",SPContext.Current.Web.CurrentUser.Name);
}
}
}
Leverage CoreResultsWebPart properties
The following properties could be used to specify query:
CoreResultsWebPart.AppendedQuery
CoreResultsWebPart.FixedQuery
Example:
crwp.AppendedQuery = string.Format("IsDocument:1 AND Author:\"{0}\"",SPContext.Current.Web.CurrentUser.Name);
To construct a query by Modified Date
it is assumed that Author
managed property is used.
Regarding query syntax, follow Keyword Query Language (KQL) syntax reference for a more details.