Export (0) Print
Expand All

Add, remove and display document promotions for a keyword by using Windows PowerShell (FAST Search Server 2010 for SharePoint)

FAST Search Server 2010
 

Applies to: FAST Search Server 2010

Topic Last Modified: 2011-02-09

noteNote
This article describes how to manage document promotions by using Windows PowerShell. For information about how to manage document promotions by using the graphical user interface, see Manage FAST Search keywords (Office.com).

In this article the following Windows PowerShell procedures are described:

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  6. Add a document promotion to a keyword:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>")
    $promotion = $keyword.AddPromotion("<PromotionName>")
    $promotion.BoostValue = "<BoostValue>"
    $promotion.PromotedItems.AddPromotedDocument("<DocumentId>")
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

    • <KeywordTerm> is the keyword term string name of an existing keyword.

    • <PromotionName> is the title of the document promotion to be added.

    • <BoostValue> is the boost value to associate with the document promotion, for example 1000.

    • <DocumentId> is the document ID (URL) for the document to be promoted.

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, create a collection of existing document promotions that you want to add:

    $promotedDocumentIds = @("<DocPromotionId1>", "<DocPromotionId2>", "<DocPromotionId3>", "<DocPromotionId4>")
    
    

    Where:

    • < DocPromotionId1-4> are the document promotions that you want to add.

  6. Get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  7. Add the collection of document promotions to a keyword:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>")
    $promotion = $keyword.AddPromotion("<PromotionName>")
    $promotion.BoostValue = "<BoostValue>"
    foreach ($promotedDocumentId in <$promotedDocumentIds>) { $promotion.PromotedItems.AddPromotedDocument($promotedDocumentId) }
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

    • <KeywordTerm> is the keyword term string name of an existing keyword.

    • <PromotionName> is the title of the promotion to be added.

    • <BoostValue> is the boost value to associate with the promotion, for example 1000.

    • <$promotedDocumentIds> is an existing variable that contains an array or collection of strings specifying the documents to be promoted with document ids (URIs.)

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  6. Remove a document promotion from a keyword:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>")
    $promotedItems = $keyword.Promotions["<PromotionName>"].PromotedItems
    foreach ($promotedDocument in @($promotedItems.GetPromotedDocumentEnumerator())) { if ($promotedDocument.DocumentId -eq "<DocumentId>") {
    $promotedItems.Remove($promotedDocument)}}
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

    • <KeywordTerm> is the keyword term string name of an existing keyword.

    • <PromotionName> is the title of the document promotion to be removed.

    • <DocumentId> is the document ID (URL) of the document promotion to be removed.

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  6. Remove all document promotions from a keyword:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>")
    $promotedItems = $keyword.Promotions["<PromotionName>"].PromotedItems
    foreach ($promotedDocument in @($promotedItems.GetPromotedDocumentEnumerator())) { $promotedItems.Remove($promotedDocument) }
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

    • <KeywordTerm> is the keyword term string name of an existing keyword.

    • <PromotionName> is the title of an existing promotion from which to remove all document promotions.

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  6. Add a global document promotion:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $globalPromotions = $searchSettingGroup.PromotionsWithoutKeyword
    $globalPromotion = $globalPromotions.AddPromotion("<GlobalPromotionName>") 
    $globalPromotion.BoostValue = "<BoostValue>"
    $globalPromotion.PromotedItems.AddPromotedDocument("<DocumentId>")
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

    • <GlobalPromotionName> is the name of the global document promotion to be added.

    • <BoostValue> is the boost value to associate with the global document promotion, for example 1000.

    • <DocumentId> is the document ID (URL) of the document to be promoted.

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, create a collection of existing global document promotions that you want to add:

    $globalDocPromotionsToAdd = @("<GlobalDocPromotion1>", "<GlobalDocPromotion2>", "<GlobalDocPromotion3>", "<GlobalDocPromotion4>")
    
    

    Where:

    • <GlobalDocPromotion1-4> are the global document promotions that you want to add.

  6. Get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  7. Add the collection of global document promotions:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $globalPromotions = $searchSettingGroup.PromotionsWithoutKeyword
    foreach ($promotionToAdd in <$globalDocPromotionsToAdd>) { $newPromotion = $globalPromotions.AddPromotion($promotionToAdd) ; $newPromotion.PromotedItems.AddPromotedDocument($promotionToAdd) }
    
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

    • <$globalDocPromotionsToAdd > is an existing variable that contains an existing array or collection of strings specifying the names of the existing global document promotions to be added.

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  6. Remove a global document promotion:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $globalPromotions = $searchSettingGroup.PromotionsWithoutKeyword
    $globalPromotion = $globalPromotions.GetPromotion("<GlobalPromotionName>") 
    $promotedItems = $globalPromotion.PromotedItems
    foreach ($promotedDocument in @($promotedItems.GetPromotedDocumentEnumerator())) { if ($promotedDocument.DocumentId -eq "<DocumentId>") { $promotedItems.Remove($promotedDocument) }}
    
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

    • <GlobalPromotionName> is the name of an existing promotion from which to remove a global document promotion.

    • <DocumentId> is the document ID (URL) of the global document promotion to be removed.

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  6. Remove all global document promotions:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $globalPromotions = $searchSettingGroup.PromotionsWithoutKeyword
    foreach ($globalPromotion in $globalPromotions) { $globalPromotedItems = $globalPromotion.PromotedItems;  foreach ($promotedDoc in @($globalPromotedItems.GetPromotedDocumentEnumerator())) { $globalPromotedItems.Remove($promotedDoc) } }
    
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

  1. Verify that you meet the following minimum requirements: You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.

  2. On the Start menu, click All Programs.

  3. Click Microsoft FAST Search Server 2010 for SharePoint.

  4. Click Microsoft FAST Search Server 2010 for SharePoint shell.

  5. At the Windows PowerShell command prompt, get all search setting groups:

    Get-FASTSearchSearchSettingGroup
    
    >>Name        : 9c65a55f-eafc-451d-b0f5-56fbed465141
    >>Description :
    >>Id          : 1
    >>LastChanged : 10/19/2010 9:04:46 AM
                     
    
  6. Display all promotions:

    $searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" 
    $searchSettingGroup.promotions
    
    
    

    Where:

    • <SearchSettingGroupName> is the name of an existing search setting group.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft