TaxonomySession.GetTerms Method (String, Int32, Boolean, StringMatchOption, Int32, Boolean, Boolean)
Searches labels in the provided lcid, and returns Term objects from all TermSet objects, which are not scoped to a SPSite object, from all TermStore objects with a Label matching the provided string.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Function GetTerms ( _
termLabel As String, _
lcid As Integer, _
defaultLabelOnly As Boolean, _
stringMatchOption As StringMatchOption, _
resultCollectionSize As Integer, _
trimUnavailable As Boolean, _
trimDeprecated As Boolean _
) As TermCollection
'Usage
Dim instance As TaxonomySession
Dim termLabel As String
Dim lcid As Integer
Dim defaultLabelOnly As Boolean
Dim stringMatchOption As StringMatchOption
Dim resultCollectionSize As Integer
Dim trimUnavailable As Boolean
Dim trimDeprecated As Boolean
Dim returnValue As TermCollection
returnValue = instance.GetTerms(termLabel, _
lcid, defaultLabelOnly, stringMatchOption, _
resultCollectionSize, trimUnavailable, _
trimDeprecated)
public TermCollection GetTerms(
string termLabel,
int lcid,
bool defaultLabelOnly,
StringMatchOption stringMatchOption,
int resultCollectionSize,
bool trimUnavailable,
bool trimDeprecated
)
Parameters
termLabel
Type: System.StringString to search
lcid
Type: System.Int32Language to search
defaultLabelOnly
Type: System.Booleanyes if it only searches default Label objects; no if it searches all Label objects
stringMatchOption
Type: Microsoft.SharePoint.Taxonomy.StringMatchOptionHow the string is matched
resultCollectionSize
Type: System.Int32The maximum number of Term objects to return from each TermStore object.
trimUnavailable
Type: System.Booleanyes if it trims away the unavailable Term objects from the result collection; no if it includes the unavailable Term objects in the result collection.
trimDeprecated
Type: System.Booleanyes if it trims away the deprecated Term objects from the result collection; no if it includes the deprecated Term objects in the result collection.
Return Value
Type: Microsoft.SharePoint.Taxonomy.TermCollection
A sorted collection of Term objects
Remarks
The search results are returned directly from the TermStore object. It may not be synchronized with changes that have been made but not committed. For best results, call the CommitAll method or call the RollbackAll method before calling this method.