Share via


PromotionCollection.AddPromotion Method (String, String, Int32, Nullable<DateTime>, Nullable<DateTime>, Context)

Creates a promotion and adds it 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 AddPromotion ( _
    name As String, _
    description As String, _
    boostValue As Integer, _
    start As Nullable(Of DateTime), _
    end As Nullable(Of DateTime), _
    context As Context _
) As Promotion
'Usage
Dim instance As PromotionCollection
Dim name As String
Dim description As String
Dim boostValue As Integer
Dim start As Nullable(Of DateTime)
Dim end As Nullable(Of DateTime)
Dim context As Context
Dim returnValue As Promotion

returnValue = instance.AddPromotion(name, _
    description, boostValue, start, end, _
    context)
Promotion AddPromotion(
    string name,
    string description,
    int boostValue,
    Nullable<DateTime> start,
    Nullable<DateTime> end,
    Context context
)

Parameters

  • description
    Type: System.String

    The description to give the promotion.

  • boostValue
    Type: System.Int32

    The boost value to associate with the promotion. The boost value affects the degree to which matching result set items are promoted or demoted.

Return Value

Type: Microsoft.SharePoint.Search.Extended.Administration.Keywords.Promotion
A Promotion representing the added promotion.

Exceptions

Exception Condition
ArgumentNullException

The [name] is [null].

AdminException

The add operation.fails. An example of an add operation that will fail is adding an already existing promotion to the collection.

See Also

Reference

PromotionCollection Interface

PromotionCollection Members

AddPromotion Overload

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