ISchemaProvider::LookupAuthoredNamedEntity method (structuredquery.h)

Finds named entities of a specified type in a tokenized string, and returns the value of the entity and the number of tokens the entity value occupies.

Syntax

HRESULT LookupAuthoredNamedEntity(
  [in]  IEntity          *pEntity,
  [in]  LPCWSTR          pszInputString,
  [in]  ITokenCollection *pTokenCollection,
  [in]  ULONG            cTokensBegin,
  [out] ULONG            *pcTokensLength,
  [out] LPWSTR           *ppszValue
);

Parameters

[in] pEntity

Type: IEntity*

A pointer to an IEntity object identifying the type of named entity to locate.

[in] pszInputString

Type: LPCWSTR

An input string in which to search for named entity keywords.

[in] pTokenCollection

Type: ITokenCollection*

A pointer to the tokenization of the string in the pszInputString parameter.

[in] cTokensBegin

Type: ULONG

The zero-based position of a token in the pTokenCollection from which to start searching.

[out] pcTokensLength

Type: ULONG*

Receives a pointer to the number of tokens covered by the named entity keyword that was found.

[out] ppszValue

Type: LPWSTR*

Receives a pointer to the value of the named entity that was found, as a Unicode string. The caller must free the string by calling CoTaskMemFree. An INamedEntity object can be obtained by calling the GetNamedEntity method of pEntity and passing the string that was received in this parameter.

Return value

Type: HRESULT

Returns S_OK if the token sequence beginning at position cTokensBegin denotes a named entity of the specified (entity) type. If there is no such token sequence, returns S_FALSE.

Remarks

The method finds only named entities authored with keywords in the schema, not named entities recognized by an IConditionGenerator object.

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 structuredquery.h
Redistributable Windows Desktop Search (WDS) 3.0