Export (0) Print
Expand All
Expand Minimize

SearchVocabulary Method

HealthVault
Searches a specific vocabulary and retrieves the matching vocabulary items.

Namespace: Microsoft.Health
Assembly: Microsoft.Health (in Microsoft.Health.dll) Version: 2.1.0.0 (1.15.1003.9505)

public static VocabularyItemCollection SearchVocabulary(
	HealthServiceConnection connection,
	VocabularyKey vocabularyKey,
	string searchValue,
	VocabularySearchType searchType,
	Nullable<int> maxResults
)

Parameters

connection
Type: Microsoft.Health..::..HealthServiceConnection
The connection to use for this operation. The connection must have application capability.
vocabularyKey
Type: Microsoft.Health..::..VocabularyKey
The VocabularyKey defining the vocabulary to search. If the family is not specified, the default HealthVault vocabulary family is used. If the version is not specified, the most current version of the vocabulary is used.
searchValue
Type: System..::..String
The search string to use.
searchType
Type: Microsoft.Health..::..VocabularySearchType
The type of search to perform.
maxResults
Type: System..::..Nullable<(Of <(<'Int32>)>)>
The maximum number of results to return. If null, all matching results are returned, up to a maximum number defined by the service config value with key maxResultsPerVocabularyRetrieval.

Return Value

A VocabularyItemCollection populated with entries matching the search criteria.

This method does text search matching of display text and abbreviation text for the culture defined by the Culture. The searchValue is a string of characters in the specified culture.

ExceptionCondition
System..::..ArgumentException If vocabularyKey is null.
-Or-
If searchValue is null or empty or greater than 255 characters.
-Or-
if searchType is not a known VocabularySearchType value.
-Or-
when maxResults is defined but has a value less than 1.
Microsoft.Health..::..HealthServiceException There is an error in the server request.
-Or-
The requested vocabulary is not found on the server.
-Or- The requested search culture is not supported.
Show:
© 2014 Microsoft