TaxonomySession.GetTerms method (String, Int32, Boolean)

Gets Term objects from all of the TermSet objects, which are not scoped to an 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

  • trimUnavailable
    Type: System.Boolean

    yes 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 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. The TermStore object 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.

See also

Reference

TaxonomySession class

TaxonomySession members

GetTerms overload

Microsoft.SharePoint.Taxonomy namespace

Term

Labels