Article ID: 946484 - View products that this article applies to.
When you use a Collaborative Application Markup Language (CAML) query to search content on a Microsoft Office SharePoint Server 2007 site or on a Windows SharePoint Services 3.0 site, the search results are incomplete. This problem occurs when the query uses the SPSiteDataQuery class.
This problem occurs for one of the following reasons:
To resolve this issue use the Infrastructure Update hotfix for Windows SharePoint Services: For more information about the available hotfix, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/951695/ )Description of the Infrastructure Update for Windows SharePoint Services 3.0: July 15, 2008
To work around this problem, use one of the following methods.
Method 1: Use the same column mapping for each field in the Where clauseTo work around this problem, use the same column mapping for each field in the Where clause. When you use the same column mapping for each field in the Where clause, the query returns the correct results when you search for content in many document libraries, in many document lists, and in many explicit GUIDs.
Any field that will be in the Where clause has to map to the same database column on every list that will be included in an SPSiteDataQuery class. The order in which the fields appear in the Where clause does not matter To make sure that the field mapping is homogeneous, start from scratch and add the same set of columns in the same order. The field type does matter. Number fields will not interfere with Text fields. For example, consider List A, List B and six Number or Text fields, added in the following order:
A query across lists that included only N1, N4, or T1 in the Where clause would be correct. However, a query that included N2 or N3 would not be correct. A query that included N5 would omit List A from the query, and would be correct by design. Windows SharePoint Services does not fill in missing fields in the Where clause. If N6 had been added to List A first, only the following query for T1 would be correct:
Method 2: Use multiple queriesTo work around this problem, perform multiple queries. Use 10 or fewer document libraries, document lists, or explicit GUIDs in each query. Then, combine the results into a complete set.
For more information about the SPSiteDataQuery.Lists property, visit the following Microsoft Web site: