INamedEntityCollector::Add method (structuredquery.h)

Adds a single (potential) named entity to this INamedEntityCollector collection, as identified in a tokenized span of the input string being parsed.

Syntax

HRESULT Add(
  [in] ULONG                  beginSpan,
  [in] ULONG                  endSpan,
  [in] ULONG                  beginActual,
  [in] ULONG                  endActual,
  [in] IEntity                *pType,
  [in] LPCWSTR                pszValue,
  [in] NAMED_ENTITY_CERTAINTY certainty
);

Parameters

[in] beginSpan

Type: ULONG

The beginning of the overall token span, including any leading quotation marks.

[in] endSpan

Type: ULONG

The end of the overall token span including any trailing quotation marks.

[in] beginActual

Type: ULONG

The beginning of the part of the token span that identifies the potential named entity.

[in] endActual

Type: ULONG

The end of the part of the token span that identifies the potential named entity.

[in] pType

Type: IEntity*

The semantic type of the named entity.

[in] pszValue

Type: LPCWSTR

The name of the entity as a string.

[in] certainty

Type: NAMED_ENTITY_CERTAINTY

One of the following values:

Value Information
NEC_LOW It could be this named entity, but additional evidence is advisable.
NEC_MEDIUM It is likely this named entity; it is okay to use it.
NEC_HIGH It almost certainly is this named entity; it should be okay to discard other possibilities.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

When a query parser parses an input string into condition nodes, the parser invokes an IConditionGenerator object that, in turn, invokes INamedEntityCollector::Add to collect possible named entities in the input string. The IConditionGenerator object must call this method for each potential named entity it recognizes in the input string. For each entity, the condition generator must provide the following information:

  • what part of the input string it covers
  • the semantic type of the named entity
  • a string representation of the value of the named entity
  • the level of certainty that the input really is that named entity
If the named entity was used in the interpretation of the input string, the GenerateForLeaf method of the condition generator will be invoked with the value string as one of the arguments.

The following relationship must be maintained between the four first arguments: beginSpan = beginActual < endActual = endSpan.

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