TermSet.GetTerms TermSet.GetTerms TermSet.GetTerms Method

Definition

Overloads

GetTerms(String, Int32, Boolean, StringMatchOption, Int32, Boolean) GetTerms(String, Int32, Boolean, StringMatchOption, Int32, Boolean)

Gets a collection of all Term objects from the current TermSet with a Label in the provided LCID matching the string provided, with an option to only search default labels.

GetTerms(String, Boolean, StringMatchOption, Int32, Boolean) GetTerms(String, Boolean, StringMatchOption, Int32, Boolean)

Gets a collection of all Term objects from the current TermSet object with a Label matchingthe string provided in any LCID, with an option to only search default labels.

GetTerms(String, Int32, Boolean) GetTerms(String, Int32, Boolean) GetTerms(String, Int32, Boolean)

Gets a collection of all Term objects from the current TermSet object with a Label in the specified LCID matching the string provided.

GetTerms(String, Boolean) GetTerms(String, Boolean) GetTerms(String, Boolean)

Gets a collection of all Term objects from the current TermSet that have a Label object that matches the string provided in any LCID.

GetTerms(String, Int32, Boolean, StringMatchOption, Int32, Boolean) GetTerms(String, Int32, Boolean, StringMatchOption, Int32, Boolean)

Gets a collection of all Term objects from the current TermSet with a Label in the provided LCID matching the string provided, with an option to only search default labels.

public:
 Microsoft::SharePoint::Taxonomy::TermCollection ^ GetTerms(System::String ^ termLabel, int lcid, bool defaultLabelOnly, Microsoft::SharePoint::Taxonomy::StringMatchOption stringMatchOption, int resultCollectionSize, bool trimUnavailable);
public Microsoft.SharePoint.Taxonomy.TermCollection GetTerms (string termLabel, int lcid, bool defaultLabelOnly, Microsoft.SharePoint.Taxonomy.StringMatchOption stringMatchOption, int resultCollectionSize, bool trimUnavailable);
Parameters
termLabel
String String String

The Label of the Term to get

lcid
Int32 Int32 Int32

The locale identifier of the Term.Labels to be matched

defaultLabelOnly
Boolean Boolean Boolean

Indicates whether only default labels should be included in the search.

stringMatchOption
StringMatchOption StringMatchOption StringMatchOption

Whether to search for labels that start with the specified string, or those that have an exact match.

resultCollectionSize
Int32 Int32 Int32

The maximum number of Term objects to include in the returned TermCollection object.

trimUnavailable
Boolean Boolean Boolean

A Boolean indicating whether to trim out Term objects that have the IsAvailableForTagging property set to false.

Returns

A collection of all Term objects from the current TermSet with a Label in the provided LCID matching the string provided, with an option to only search default labels.

Exceptions

The termLabel cannot be a null reference (Nothing in Visual Basic) or empty.

The value of termLabel is invalid. It probably contains invalid characters or is too long.

The lcid value must be one of the working languages in the current TermStore object.

Remarks

If trimUnavailable is true, then Term objects with the IsAvailableForTagging property set to false will be trimmed from the results; otherwise all Term objects will be returned regardless of their IsAvailableForTagging value. All Term.Labels in the language matching the lcid parameter will be searched by this method. The search is case-insensitive, and will match either the entire label or only check that it starts with the specified string depending on the value of the stringMatchOption parameter. The maximum number of results returned from this search is restricted by the resultCollectionSize parameter.The termLabel cannot be a null reference (Nothing in Visual Basic) or empty, and must not exceed 255 characters in length.It also cannot contain any of the following illegal characters: ;"<>|&tab. The lcid value must be one of the working languages of the T:Microsoft.SharePoint.Taxonomy.TermStore object as specified by TermStore.Languages.To get the most accurate results, Microsoft recommends using the Microsoft.SharePoint.Taxonomy.TermStoreobject.CommitAll method to commit changes to the database before executing this search.

GetTerms(String, Boolean, StringMatchOption, Int32, Boolean) GetTerms(String, Boolean, StringMatchOption, Int32, Boolean)

Gets a collection of all Term objects from the current TermSet object with a Label matchingthe string provided in any LCID, with an option to only search default labels.

public:
 Microsoft::SharePoint::Taxonomy::TermCollection ^ GetTerms(System::String ^ termLabel, bool defaultLabelOnly, Microsoft::SharePoint::Taxonomy::StringMatchOption stringMatchOption, int resultCollectionSize, bool trimUnavailable);
public Microsoft.SharePoint.Taxonomy.TermCollection GetTerms (string termLabel, bool defaultLabelOnly, Microsoft.SharePoint.Taxonomy.StringMatchOption stringMatchOption, int resultCollectionSize, bool trimUnavailable);
Parameters
termLabel
String String String

The Label of the Term to get

defaultLabelOnly
Boolean Boolean Boolean

true if default labels should be included in the search; otherwise, false

stringMatchOption
StringMatchOption StringMatchOption StringMatchOption

Whether to search for labels that start with the specified string, or those that have an exact match.

resultCollectionSize
Int32 Int32 Int32

The maximum number of Term objects to include in the returned TermCollection object.

trimUnavailable
Boolean Boolean Boolean

A Boolean indicating whether to trim out Term objects that have the IsAvailableForTagging property set to false.

Returns

A collection of all Term objects from the current TermSet with a Label matching the string provided in any LCID, with an option to only search default labels.

Exceptions

The termLabel cannot be a null reference (Nothing in Visual Basic) or empty.

The value of termLabel is invalid. It probably contains invalid characters or is too long.

Remarks

If trimUnavailable is true, then Term objects with the IsAvailableForTagging property set to false will be trimmed from the results; otherwise all Term objects will be returned regardless of their IsAvailableForTagging value. All Term.Labels in all working languages will be searched by this method. The search is case-insensitive, and will match either the entire label or only check that it starts with the specified string depending on the value of thestringMatchOption parameter. The maximum number of results returned from this search is restricted by the resultCollectionSize parameter.The termLabel cannot be a null reference (Nothing in Visual Basic) or empty, and must not exceed 255 characters in length.It also cannot contain any of the following illegal characters: ;"<>|&tab. To get the most accurate results, Microsoft recommends using the Microsoft.SharePoint.Taxonomy.TermStoreobject.CommitAll method to commit changes to the database before to executing this search.

GetTerms(String, Int32, Boolean) GetTerms(String, Int32, Boolean) GetTerms(String, Int32, Boolean)

Gets a collection of all Term objects from the current TermSet object with a Label in the specified LCID matching the string provided.

public:
 Microsoft::SharePoint::Taxonomy::TermCollection ^ GetTerms(System::String ^ termLabel, int lcid, bool trimUnavailable);
public Microsoft.SharePoint.Taxonomy.TermCollection GetTerms (string termLabel, int lcid, bool trimUnavailable);
Public Function GetTerms (termLabel As String, lcid As Integer, trimUnavailable As Boolean) As TermCollection
Parameters
termLabel
String String String

The Label of the Term to get

lcid
Int32 Int32 Int32

The locale identifier of the Labels to be matched.

trimUnavailable
Boolean Boolean Boolean

A Boolean indicating whether to trim out Term objects that have the IsAvailableForTagging property set to false.

Returns

A collection of all Term objects from the current TermSet with a Label object in the provided LCID matching the string provided.

Exceptions

The termLabel cannot be a null reference (Nothing in Visual Basic) or empty.

The value of termLabel is invalid. It probably contains invalid characters or is too long.

The lcid value must be one of the working languages in the current TermStore object.

Remarks

If trimUnavailable is true, then Term objects with the IsAvailableForTagging property set to false will be trimmed from the results; otherwise all Term objects will be returned regardless of their IsAvailableForTagging property value. All Term.Label objects in the language matching the lcid parameter will be searched by this method.The search is case-insensitive. A maximum of 100 results will be returned from this search.The termLabel cannot be a null reference (Nothing in Visual Basic) or empty, and must not exceed 255 characters in length. It also cannot contain any of the following illegal characters ; "< >|&tab. The lcid value must be one of the working languages of the TermStore object, specified by the Microsoft.SharePoint.Taxonomy.TermStoreobject.Languages property. To get the most accurate results, Microsoft recommend using the Microsoft.SharePoint.Taxonomy.TermStoreobject.CommitAll method to commit changes to the database before executing this search.

GetTerms(String, Boolean) GetTerms(String, Boolean) GetTerms(String, Boolean)

Gets a collection of all Term objects from the current TermSet that have a Label object that matches the string provided in any LCID.

public:
 Microsoft::SharePoint::Taxonomy::TermCollection ^ GetTerms(System::String ^ termLabel, bool trimUnavailable);
public Microsoft.SharePoint.Taxonomy.TermCollection GetTerms (string termLabel, bool trimUnavailable);
Public Function GetTerms (termLabel As String, trimUnavailable As Boolean) As TermCollection
Parameters
termLabel
String String String

The Label of the Term to get

trimUnavailable
Boolean Boolean Boolean

A Boolean indicating whether to trim out Term objects that have the IsAvailableForTagging property set to false.

Returns

A collection of all Term objects from the current TermSet wit h a Label matching the provided string.

Exceptions

The termLabel cannot be a null reference (Nothing in Visual Basic) or empty.

The value of termLabel is invalid. It probably contains invalid characters or is too long.

Remarks

If trimUnavailable is true, then Term objects with the IsAvailableForTagging property set to false will be trimmed from the results; otherwise all Term objects will be returned regardless of their IsAvailableForTagging value. All Label objects in all working languages will be searched by this method. The search is case-insensitive. A maximum of 100 results will be returned from this search.

The termLabel cannot be a null reference (Nothing in Visual Basic) or empty, and must not exceed 255 characters in length.It also cannot contain any of the following illegal characters: ;"<>|&tab. To get the most accurate results, Microsoft recommends that any pending changes be committed to the database using the Microsoft.SharePoint.Taxonomy.TermStoreobject.CommitAll method before you execute this search.

Applies to