ISearchQueryHelper::put_QueryContentLocale Method

Sets the language code identifier (LCID) of the query.

Syntax

HRESULT put_QueryContentLocale(      
    LCID lcid
);

Parameters

  • lcid
    [in] Sets the LCID of the query.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The locale identifier has the components necessary to uniquely identify one of the installed system-defined locales. The LCID controls a number of settings including numeric format, date format, currency format, uppercase and lowercase mapping, dictionary sort ordering, tokenization, and others. Although these settings help Windows operating system and Windows Search API provide excellent localized support, unexpected results can occur when documents from one locale are searched by a system set for another locale.

When the IFilter object processes a document's text properties and content, it reports the language of that document to the content indexer. Using this information, the Search API can apply the appropriate word breaker and noise-words list.

The locale is used for word breaking, normalizing, and stemming the string values that are extracted from the query string. If this method is not used (so the content locale is not set), ISearchQueryHelper::get_QueryContentLocale returns the active input locale.

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_QueryContentLocale