TaxonomySession.GetTerms Method (String, Int32, Boolean)
Gets Term objects from all of the TermSet objects, which are not scoped to a SPSite object, from all TermStore objects with a Label object in the provided lcid matching the string provided.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Function GetTerms ( _
termLabel As String, _
lcid As Integer, _
trimUnavailable As Boolean _
) As TermCollection
'Usage
Dim instance As TaxonomySession
Dim termLabel As String
Dim lcid As Integer
Dim trimUnavailable As Boolean
Dim returnValue As TermCollection
returnValue = instance.GetTerms(termLabel, _
lcid, trimUnavailable)
public TermCollection GetTerms(
string termLabel,
int lcid,
bool trimUnavailable
)
Parameters
termLabel
Type: System.StringString to search
lcid
Type: System.Int32Language to search
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.
Return Value
Type: Microsoft.SharePoint.Taxonomy.TermCollection
A sorted collection of Term objects
Remarks
This method searches all Label objects in the provided LCID, returns the top 100 Term objects from each TermStore, and combines the results into one sorted collection.
The search results are returned directly from TermStore. 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.