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
name
Type: System.StringThe name to give the promotion.
description
Type: System.StringThe description to give the promotion.
boostValue
Type: System.Int32The boost value to associate with the promotion. The boost value affects the degree to which matching result set items are promoted or demoted.
start
Type: System.Nullable<DateTime>The time from which the promotion is to be valid.
end
Type: System.Nullable<DateTime>The time to which the promotion is to be valid.
context
Type: Microsoft.SharePoint.Search.Extended.Administration.Keywords.ContextThe context to associate with the promotion.
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
Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace