SynonymCollection.AddSynonym Method (String, Context, SynonymExpansionType)
Adds a synonym with the specified term, context and expansion type to the collection.
Namespace: Microsoft.SharePoint.Search.Extended.Administration.Keywords
Assembly: Microsoft.SharePoint.Search.Extended.Administration (in Microsoft.SharePoint.Search.Extended.Administration.dll)
Syntax
'Declaration
Function AddSynonym ( _
synonym As String, _
context As Context, _
type As SynonymExpansionType _
) As Synonym
'Usage
Dim instance As SynonymCollection
Dim synonym As String
Dim context As Context
Dim type As SynonymExpansionType
Dim returnValue As Synonym
returnValue = instance.AddSynonym(synonym, _
context, type)
Synonym AddSynonym(
string synonym,
Context context,
SynonymExpansionType type
)
Parameters
synonym
Type: System.StringThe synonym term.
context
Type: Microsoft.SharePoint.Search.Extended.Administration.Keywords.ContextThe context to which this synonym is to be attached.
type
Type: Microsoft.SharePoint.Search.Extended.Administration.Keywords.SynonymExpansionTypeThe expansion type of the synonym.
Return Value
Type: Microsoft.SharePoint.Search.Extended.Administration.Keywords.Synonym
A Synonym representing the added synonym.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | If the synonym name is [null]. |
AdminException | If the synonym name is already used by another synonym for the keyword. |
AdminException | If the synonym name is already used by another keyword. |
See Also
Reference
Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace