SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

MOSS Search: TotalAvailable & TotalRows not accurate

A query against MOSS search engine returns a specified number of results and a indication of the total number of results. When working with the API this is the TotalRows property of the ResultsTable, working with the WebService this is the TotalAvailable element of the ResponsePacket.

If you, like me, want to base your paging on the TotalRows or TotalAvailable properties and you expect it to return the exact number of results you're in for some strange behaviour...

I do not have a nice solution yet, although the API also exposes the IsTotalRowsExact property. This will tell you when you're on the save side. The webservice ResponsePacket has not got an equalivant property.

The MSDN documentation of the API does not mention this number not being exact: http://msdn2.microsoft.com/en-us/library/microsoft.office.server.search.query.resulttable_members.aspx

The webservice documentation actually does mention it: http://msdn2.microsoft.com/en-us/library/aa193748(office.11).aspx#RangeType_TotalAvailable

"The total number available. This number may not be 100% accurate and all these results may not be accessible."

The number will become more accurate once you move to the end of the resultset.

Be warned...


Posted 01-21-2008 7:35 AM by Sander de Koning

Comments

SharePoint Link Love: 01-27-2008 part six at Virtual Generations wrote SharePoint Link Love: 01-27-2008 part six at Virtual Generations
on 01-27-2008 8:13 AM

Pingback from  SharePoint Link Love: 01-27-2008 part six at  Virtual Generations

SharePoint Link Love: 01-27-2008 part four at Virtual Generations wrote SharePoint Link Love: 01-27-2008 part four at Virtual Generations
on 01-27-2008 8:22 AM

Pingback from  SharePoint Link Love: 01-27-2008 part four at  Virtual Generations

Zelota wrote re: MOSS Search: TotalAvailable & TotalRows not accurate
on 08-27-2008 7:01 AM

Solution:

queryResults.Tables[0].ExtendedProperties["TotalRows"]

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.