ISearchQueryHelper::put_QuerySorting Method
Sets the sort order for the query result set.
Syntax
HRESULT put_QuerySorting( LPCWSTR pszSorting );
Parameters
- pszSorting
[in, unique] A comma-delimited, null-terminated Unicode string that specifies the sort order.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
ppszSorting must be a valid ORDER BY clause (without the ORDER BY keyword). Windows Search SQL supports sorting on multiple properties, in either ascending (ASC) or descending (DESC) order on each property. For example, ppszSorting might contain the following:
System.ItemAuthors ASC, System.ItemDate DESC
The DSearch code sample, available on Code Gallery and the Windows 7 SDK, demonstrates how to create a class for a static console application to query Windows Search using the Microsoft.Search.Interop assembly for ISearchQueryHelper.
See Also
ISearchQueryHelper::get_QuerySorting, Overview of Windows Search SQL