Searching the Exchange Store
Topic Last Modified: 2006-06-12
This section contains common search tasks used with the Exchange store. The examples in this section use the Microsoft® ActiveX® Data Objects (ADO) 2.5 Component Object Model (COM) component running on the same computer as the Exchange store.
The search condition scope for most of these tasks is a shallow traversal, which is the default scope if no scope is specified. The Simple Query programming task contains commented code to show how to explicitly specify a shallow traversal. You can also search subfolders using the methods found in Specifying a Deep Traversal if the search is not being done within a MAPI public store. Attempting to do a deep traversal search on a MAPI store will cause a run-time error.
Note that calculated properties are Non-Searchable Properties and should not be used in the SELECT Statement of the Structured Query Language (SQL) query.
You can improve search performance by employing the following techniques:
- Take advantage of the Exchange store by Using Full-Text Indexing.
- Using Relative URLs to improve performance and simplify coding.
- Pass one ADO Connection object to routines that open recordsets and process search results.
- If you are searching on a property that you defined with a property definition, you should use the CAST Function to cast its data type to a known XML data type to ensure that it will be recognizable by the Exchange store. Custom strings and Boolean properties, however, do not require casting.
- Use the RANK BY Clause to sort results based on how frequently and where the queried strings appear in the indexed documents.
- Use the ORDER BY Clause to sort the returned recordset in ascending or descending order according to one or more properties specified.
This section consists of the following topics:
Getting Item Counts with GROUP BY
Searching Calendar Folders with WebDAV
Specifying Row Ranges in a Search
Rendering Search Results with XSL
Searching/Listing Items Using ADO