Generates an SQL query based on user or client input. The user or client input can be either an Advanced Query Syntax (AQS) or Natural Query Syntax (NQS) query.
Syntax
|
HRESULT GenerateSQLFromUserQuery( LPCWSTR pszQuery,
LPWSTR *pwszSQL
); |
Parameters
- pszQuery
-
[in] The pointer to a null-terminated, Unicode string containing a query in AQS or NQS.
- pwszSQL
-
[out, retval] When this method returns, contains the address of a pointer to an SQL query string based on pszQuery.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
This method generates SQL in the following form:
|
SELECT <QuerySelectColumns> FROM <CatalogName that created query helper>
WHERE <QueryWhereRestrictions> AND <Result of interpreting the User
query passed into this function according to QuerySyntax>. |
The QuerySyntax must be one of the SEARCH_QUERY_SYNTAX enumerated types.
The SQL generation also uses the values set with ISearchQueryHelper::put_QueryTermExpansion and ISearchQueryHelper::put_QueryContentProperties, and ORDER BY ISearchQueryHelper::put_QuerySorting.
See Also
ISearchQueryHelper::get_QuerySyntax