Skip Ribbon Commands
Skip to main content

SharePoint Engineer

:

SharePoint Engineer > Posts > Why do my Search Scopes show no Counts
April 01
Why do my Search Scopes show no Counts

I was recently asked to investigate a problem in an environment where the SharePoint Central Admin Search Admin Scopes Page was timing out with an exception

                See: http://CA:PORT/_admin/search/viewscopes.aspx?appid=<GUID>
 
Scopes1.JPG

During the investigation it became clear that this problem is related to a product bug addressed here : ​http://support.microsoft.com/kb/2537539 although in my case the problem was generated due to OM call and not a search webservice call. A product bug has been filed for this behaviour too

  

The problem typically manifests under fairly specific conditions
  1. Search Scopes have very broad rules resulting in millions of items being in the focus
  2. The Search Index is sufficiently large to cause a Query Processor timeout during Query
 
Root Cause
 
When opening the viewscopes.aspx page a number of things happen
  1. The number and name of all the scopes are read from the administration database
  2. Each scope is processed in turn
    The scope rules are processed – This determines what falls “in scope” from the search index
    Each item that is returned will need to be security trimmed against the requesting user before being added to the scope item count
  3. When each scope is fully calculated the page returns
 
When this bug is in evidence the page never either returns scopes with blank counts or error counts or sometime never returns due to the rules processing and security trimming process taking longer than 10 seconds (product hard coded timeout) to complete for MULTIPLE scopes;

 

The important differentiator with specifically this customer is that they have hundreds of large scopes needing evaluation resulting in many of these timeout events and ultimately the 2 minute page load timeout is exceeded and an exception raised

 

 
Investigation
 
If you come across this issue you can check ULS for entries similar to the following (see the timings in green highlights that are the dead giveaway to a Timeout)
 

 03/28/2012 00:10:57.96         w3wp.exe (SERVER:0x20E8)    0x11C0    SharePoint Server Search       Query Processor      dm22       Medium                Resetting cookie: Old value = '', new value = 'select workid from scope() where "scope"='All Sites''               2efb3fde-5b18-4e00-a215-dbf58982f78e

 

03/28/2012 00:11:02.00         mssearch.exe (SERVER:0x2B20)              0x15F4    SharePoint Server Search       Query Processor      e0pg                Medium  01157ab3-7d92-45a6-8a0e-8bb6689e04af-query-18: Query completed 4031 ms, detailed time:  Query stage execution ms times: 0 4031 0 0 4031 0 0 0   Query stage cpu ms times: 0 0 0 0 0 0 0 0   Query stage hit counts: 1 1 1 7 1 0 0 0   Cursor count: 79  Mapped page count: 74  Total index count: 27    [srequest.cxx:5526]  d:\office\source\search\native\ytrip\tripoli\cifrmwrk\srequest.cxx     2efb3fde-5b18-4e00-a215-dbf58982f78e

  

03/28/2012 00:11:02.03         w3wp.exe (SERVER:0x20E8)    0x11C0    SharePoint Server Search       Query Processor      e2kf         Medium                Security trimming retry 360 935 0         2efb3fde-5b18-4e00-a215-dbf58982f78e

  

03/28/2012 00:12:05.91         w3wp.exe (SERVER:0x20E8)    0x11C0    SharePoint Server Search       Exceptions               1hjo         Medium                Exception thrown: 0x80040e31 (d:\office\source\search\native\ytrip\tripoli\icommand\rowsetreader.cxx:150 ip 0x000007FEF1FF6F6F)                2efb3fde-5b18-4e00-a215-dbf58982f78e

  

03/28/2012 00:12:05.91         mssearch.exe (SERVER:0x2B20)              0x15F4    SharePoint Server Search       Query Processor      e0pg                Medium  01157ab3-7d92-45a6-8a0e-8bb6689e04af-query-9: Query completed 26252 ms, detailed time:  Query stage execution ms times: 0 6360 19892 0 2000 0 0 0   Query stage cpu ms times: 0 1343 19812 0 0 0 0 0   Query stage hit counts: 1 1 456 7 1 0 0 0   Cursor count: 95  Mapped page count: 93  Total index count: 32    [srequest.cxx:5526]  d:\office\source\search\native\ytrip\tripoli\cifrmwrk\srequest.cxx           2efb3fde-5b18-4e00-a215-dbf58982f78e

  

03/28/2012 00:12:05.93         w3wp.exe (SERVER:0x20E8)    0x11C0    SharePoint Server Search       Query Processor      e2o1        High        In CRootQuerySpec::Execute - caught exception: 0x80040e31, translated to: 0x80040e31     2efb3fde-5b18-4e00-a215-dbf58982f78e

  

03/28/2012 00:12:05.93         w3wp.exe (SERVER:0x20E8)    0x11C0    SharePoint Server Search       Administration        0000        High        Log Query: More Information: Execution stopped because a resource limit was reached. No results were returned.             2efb3fde-5b18-4e00-a215-dbf58982f78e

  

Additional Information

 

 Interestingly these ULS entries are not uncommon. If you ever look at a scopes management page either in Central Admin or at the Site Collection level and the scope shows no items returned or an error message – this is why. It does not mean the scope is broken but merely that the search engine timed out before evaluating it properly. It will also not stop search from returning results normally when requested to do so from that scope since the result set is generally much smaller than the whole scope.

  

The good news

   

Thanks for reading this far. Now for the good bit
  
Search scopes even when suffering this problem are fully manageable using PowerShell so despite the UI issues we can continue to work with scopes relatively unhindred.
 
I'll follow up with some simple scope management steps incase you run into this.

 

Comments

There are no comments for this post.