views:

15

answers:

1

Hello everyone,

I am using VSTS 2008 + C# + .Net 3.5 + ASP.Net + SharePoint Server Enterprise 2007 on IIS 7.0 with Windows Server 2008 Enterprise.

I am currently using queryex web serivces API to get matched query results for a specific query. My question is, how to get the number of matched query results without returning the whole query results? I only need the number of matched query results.

http://msdn.microsoft.com/en-us/library/search.queryservice.queryex(v=office.12).aspx

thanks in advance, George

+1  A: 

I haven't used queryex, however, looking at the MSDN doco, it returns a DataSet. The doco says that each query resultset returns a DataTable. By doing DataTable.Rows.Count, I think you should be able to get the number of results.

HTH

Mike
What I mean is how to get the number of result without getting the whole dataset? i.e. I only need the number of results.
George2
Ah, I can appreciate your problem. You don't want to have to suck the entire dataset down the wire to simply ask how many records there are. I don't think I quite understood you the first time. I've been unable to find a way of achieving this out of the box. You may be needing to cut some custom code and wrap it in a web service. It looks like the search web service wraps Microsoft.Office.Server.Search.Query (MOSS 2007 SDK rather than WSS SDK). Depending on the use case, I'd probably look to cache the results on the server, expecting them to be requested next. Wish I could be more helpful. HTH
Mike