TaxonomySession.GetTerms method (String, Boolean)
Gets from all TermStore objects with a Label object that matches the provided string, the Term objects from all TermSet objects that are not scoped to an SPSite object.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Function GetTerms ( _
termLabel As String, _
trimUnavailable As Boolean _
) As TermCollection
'Usage
Dim instance As TaxonomySession
Dim termLabel As String
Dim trimUnavailable As Boolean
Dim returnValue As TermCollection
returnValue = instance.GetTerms(termLabel, _
trimUnavailable)
public TermCollection GetTerms(
string termLabel,
bool trimUnavailable
)
Parameters
termLabel
Type: System.StringString to search.
trimUnavailable
Type: System.Booleanyes if it trims the unavailable Term objects from the result collection; no if it includes the unavailable Term objects in the result collection.
Return value
Type: Microsoft.SharePoint.Taxonomy.TermCollection
A sorted collection of Term objects.
Remarks
The method searches all Label objects in all working languages and returns the top 100 Term objects from each TermStore object and combines the results into one sorted collection. The search results are returned directly from the TermStore. The TermStore object may not be synchronized with changes that have been made but that have not yet been committed. For the best results, call the CommitAll() method or call the RollbackAll() method before you call this method.