Search Query Path

When a query is submitted, the ServerXMLHTTP object on the dashboard site passes the SQL to the Internet Server API (ISAPI) extension in the DAV provider. The DAV provider runs in the IIS process on the SharePoint Portal Server computer. The ISAPI extension parses the query and routes it through parallel paths. The possible routes, as illustrated in figure 11, include the SharePoint Portal Server document store, the Search engine, or both. This dual path takes advantage of the Web Storage System, while providing a path to the Search engine for full-text searching. SharePoint Portal Server uses the Web Storage System technology for its document library because of its ability to store structured non-textual data.

Figure 11: Query Path Architecture

How SharePoint Portal Server routes a query depends in part on the traversal style used in the scope function for the query. Traversal style refers to the depth of the folder structure being searched. Shallow traversal searches are limited to the current folder, whereas deep traversal queries span all subfolders. Shallow traversal for property match queries of folders in the document library are routed by the ISAPI extension in the DAV provider to the SharePoint Portal Server document store.

Another factor in query routing is whether or not the query uses full-text predicates, such as "FREETEXT" and "CONTAINS". All full-text queries (regardless of their traversal depth) and all deep traversal queries get routed to the Search engine.

Note

Queries that are routed to the Search engine may be run against one or more catalogs if the server has one or more DCIs. This can cause an unnecessary degradation in performance and can be avoided by prepending the catalog name to the scope function as follows: "workspace1..scope()". For more information about qualifying the scope function, see Scope Specifications.

The following table shows the query path for queries that use a combination of traversal depth, type of content, and scope.

Traversal depth Search for Scope Query path
Shallow Properties only Document library SharePoint Portal Server document store
Shallow Content and properties Document library or catalog Search engine
Deep Content and/or properties Document library or catalog Search engine

The following example demonstrates a query that is routed to the Search engine to be matched against the full-text index. This query retrieves all documents satisfying the query "design documents" and with the author, "Michael Dunn."

SELECT "DAV:href", "DAV:displayname" 
FROM SCOPE('DEEP TRAVERSAL OF "/Workspace"')
WHERE FREETEXT('design documents')
AND "urn:schemas-microsoft-com:office:office#Author" = 'Michael Dunn'
ORDER BY RANK DESC

The following example demonstrates a query that is routed to the SharePoint Portal Server document store. This query retrieves documents in the "Design" folder with the author, "Michael Dunn."

SELECT "DAV:href", "DAV:displayname" 
FROM SCOPE('SHALLOW TRAVERSAL OF "/Workspace/Documents/Design"')
WHERE "urn:schemas-microsoft-com:office:office#Author" = 'Michael Dunn' 

Shallow traversal queries of the Category folder are sent to both the SharePoint Portal Server document store and the Search engine.

Scoping a query to a Category folder causes the query to be run against all the server catalogs. This includes auto-categorized in addition to manually provided category results. Qualifying the scope function with a specific catalog name overrides this behavior.

The following table shows the query path for category queries that use a combination of traversal depth, type of content, and scope.

Traversal depth Search for Query path
Shallow Properties only SharePoint Portal Server document library and Search engine
Deep Content and/or properties Search engine

The following example demonstrates a category query that is routed to both the Search engine and the document store. This query retrieves documents in the "Design" folder with the author, "Michael Dunn" that are categorized or auto-categorized under the "Design Docs" category.

SELECT "DAV:href", "DAV:displayname" 
FROM SCOPE('SHALLOW TRAVERSAL OF "/Workspace/Categories/Design Docs"') WHERE "urn:schemas-microsoft-com:office:office#Author" = 'Michael Dunn'

The ISAPI extension in the DAV provider joins the returned Rowsets from the query paths and composes an XML representation of the resulting Rowset to return to the client.