Share via


SynonymCollection.AddSynonym Method (String, Nullable<DateTime>, Nullable<DateTime>, SynonymExpansionType)

Adds a synonym with the specified term, date range, 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, _
    start As Nullable(Of DateTime), _
    end As Nullable(Of DateTime), _
    type As SynonymExpansionType _
) As Synonym
'Usage
Dim instance As SynonymCollection
Dim synonym As String
Dim start As Nullable(Of DateTime)
Dim end As Nullable(Of DateTime)
Dim type As SynonymExpansionType
Dim returnValue As Synonym

returnValue = instance.AddSynonym(synonym, _
    start, end, type)
Synonym AddSynonym(
    string synonym,
    Nullable<DateTime> start,
    Nullable<DateTime> end,
    SynonymExpansionType type
)

Parameters

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

SynonymCollection Interface

SynonymCollection Members

AddSynonym Overload

Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace