SharePoint Search Alerts and the Case of Only 10 Results

February 21, 2014

A puzzling SharePoint search alert behaviour was keeping our team of three scratching our heads for days. If you speak Spanish, you can check my teammates' blog posts about this same error: Ignasi and Miguel.

SYMPTOMS

You have a SharePoint search configured correctly in SharePoint 2010/2013. You search for a keyword and create a search alert for the results.

image

You make more than 10 changes that should trigger the alert. However, the search alert email you receive lists only 10 changes. The rest of the changes are not sent as alerts.

CAUSE

The Search Alert mechanism in SharePoint 2010/2013 is described in great detail in the following MSDN article. In a nutshell, the process is as follows:

  1. The alert is invoked once a day ("daily summary") or once a week ("weekly summary").
  2. The alert runs the query again with the user-supplied search criteria (in my example case: "Hello").
  3. If there are no new results (the results that are more recent than the last time the alert was run), the alert finishes.
  4. If there are new results, they are formatted according to the search alert email template and sent to the user.

There is one tiny bit of missing information here. The step 2, where the search query is run again, has a hidden parameter that limits the number of results that are returned from the search index. If you look inside the SharePoint code that processes the alert, you will find a RowLimit parameter supplied to the query:

image

This searchAlertNotificationQuota is a property that is ultimately established as AlertNotificationQuota property at the SearchApplicationService object in the Sharepoint server object model.

SOLUTION

Run a PowerShell script to update this property in the Search service application and set a  number of returned search results to a value of your convenience. Let's say 75:

$sapp = Get-SPServiceApplication –Name "Search Service Application"
$sapp.AlertNotificationQuota = 75
$sapp.Update()


Profile picture

Written by Edin Kapić Insatiably curious code-writing tinkerer. Geek father. Aviation enthusiast. Cuisine journeyman. Follow me on Twitter