Search results are incomplete when you use a CAML query that uses the SPSiteDataQuery class to search content on a SharePoint Server site or on a Windows SharePoint Services site

When you use a Collaborative Application Markup Language (CAML) query to search content on a Microsoft Office SharePoint Server site or on a Windows SharePoint Services site, the search results are incomplete. This problem occurs when the query uses the SPSiteDataQuery class.

CAUSE

This problem occurs for one of the following reasons:

    The CAML query searches for content in more than 10 document libraries.
      The CAML query searches for content in more than 10 document lists.
        The CAML query searches for content in more than 10 explicit GUIDs.

        The following condition must also be true:

          The column mapping for a field in the Where clause is not the same in all the document libraries, in all the document lists, or in all the GUIDs in the query.

          This problem occurs because a different query plan is used and because data is stored in a temporary table. Additionally, this problem occurs regardless of how you select the document library, the document list, or the explicit GUID. For example, this problem may occur if you select the list by using the ServerTemplate attribute, by using the BaseType attribute, or by using the ID attribute.

          WORKAROUND

          To work around this problem, use one of the following methods.

          Method 1: Use the same column mapping for each field in the Where clause

          To 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.

          Method 2: Use multiple queries

          To 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.


          APPLIES TO
            Microsoft Office SharePoint Server 2007
              Microsoft Office SharePoint Portal Server 2003
                Microsoft Windows SharePoint Services 3.0
                  Microsoft Windows SharePoint Services 2.0
                  Microsoft Knowledge Base Article

                  This article contents is Microsoft Copyrighted material.
                  Microsoft Corporation. All rights reserved. Terms of Use | Trademarks


                  You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

                  AddThis Social Bookmark Button

                  Leave a Reply

                  *
                  To prove that you're not a bot, enter this code
                  Anti-Spam Image