ISearchQueryHelper interface (searchapi.h)

Provides methods for building a query from user input, converting a query to Windows Search SQL, and obtaining a connection string to initialize a connection to the Window Search index.

Inheritance

The ISearchQueryHelper interface inherits from the IUnknown interface. ISearchQueryHelper also has these types of members:

Methods

The ISearchQueryHelper interface has these methods.

 
ISearchQueryHelper::GenerateSQLFromUserQuery

Generates a Structured Query Language (SQL) query based on a client-supplied query string expressed in either Advanced Query Syntax (AQS) or Natural Query Syntax (NQS).
ISearchQueryHelper::get_ConnectionString

Returns the OLE DB connection string for the Window Search index.
ISearchQueryHelper::get_QueryContentLocale

Gets the language code identifier (LCID) for the query.
ISearchQueryHelper::get_QueryContentProperties

Gets the list of properties included in the query when search terms do not explicitly specify a property.
ISearchQueryHelper::get_QueryKeywordLocale

Gets the language code identifier (LCID) for the locale to use when parsing Advanced Query Syntax (AQS) keywords.
ISearchQueryHelper::get_QueryMaxResults

Gets the maximum number of results to be returned by the query.
ISearchQueryHelper::get_QuerySelectColumns

Gets the columns (or properties) requested in the SELECT statement of the query.
ISearchQueryHelper::get_QuerySorting

Gets the sort order for the query result set.
ISearchQueryHelper::get_QuerySyntax

Gets the syntax of the query.
ISearchQueryHelper::get_QueryTermExpansion

Gets the value that specifies how query terms are to be expanded.
ISearchQueryHelper::get_QueryWhereRestrictions

Gets the restrictions appended to a query in WHERE clauses.
ISearchQueryHelper::put_QueryContentLocale

Sets the language code identifier (LCID) of the query.
ISearchQueryHelper::put_QueryContentProperties

Sets the properties to include in the query if search terms do not explicitly specify properties.
ISearchQueryHelper::put_QueryKeywordLocale

Sets the language code identifier (LCID) for the locale to use when parsing Advanced Query Syntax (AQS) keywords.
ISearchQueryHelper::put_QueryMaxResults

Sets the maximum number of results to be returned by a query.
ISearchQueryHelper::put_QuerySelectColumns

Sets the columns (or properties) requested in the select statement.
ISearchQueryHelper::put_QuerySorting

Sets the sort order for the query result set.
ISearchQueryHelper::put_QuerySyntax

Sets the syntax of the query.
ISearchQueryHelper::put_QueryTermExpansion

Sets a value that specifies how query terms are to be expanded.
ISearchQueryHelper::put_QueryWhereRestrictions

Sets the restrictions appended to a query in WHERE clauses.
ISearchQueryHelper::WriteProperties

Not implemented. (ISearchQueryHelper.WriteProperties)

Remarks

This interface is obtained by calling ISearchCatalogManager::GetQueryHelper. Implement this interface as a helper class to ISearchCatalogManager.

This interface facilitates the generation of SQL queries using Advanced Query Syntax (AQS) or Natural Query Syntax (NQS). Clients can submit the SQL query to the Window Search engine by using OLE DB or Microsoft ActiveX Data Objects (ADO).

ISearchQueryHelper::GenerateSQLFromUserQuery uses regional locale settings. However, ISearchQueryHelper does not use the regional locale settings. As a result, there are inconsistencies in the SQL returned from ISearchQueryHelper::GenerateSQLFromUserQuery and ISearchQueryHelper for region specific settings such as date formats, for example.

For a sample that demonstrates how to create a class for a static console application to query Windows Search using the Microsoft.Search.Interop assembly for ISearchQueryHelper, see the DSearch sample.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2, Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 with SP1 [desktop apps only]
Target Platform Windows
Header searchapi.h
Redistributable Windows Desktop Search (WDS) 3.0

See also

Querying the Index Programmatically

Querying the Index with Windows Search SQL Syntax