Add, remove and display Best Bets for a keyword by using Windows PowerShell (FAST Search Server 2010 for SharePoint)
Applies to: FAST Search Server 2010
Note
This article describes how to manage Best Bets 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 PowerShell procedures are described:
Add a Best Bet to a keyword
Add multiple Best Bets to a keyword
Remove a Best Bets from a keyword
Remove all Best Bets from a keyword
Add a global Best Bet
Add multiple global Best Bets
Remove a global Best Bet
Remove all global Best Bets
Display all Best Bets
Add a Best Bet to a keyword
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
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
Add a Best Bet to a keyword:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>") $uri = New-Object -TypeName System.Uri -ArgumentList "<URI>" $keyword.AddBestBet("<BestBetName>", "<HTMLTeaser>", $uri)
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<KeywordTerm> is the keyword term string name of an existing keyword.
<URI> is the URI to the content of the Best Bet.
<BestBetName> is the title of the Best Bet to be added.
<HTMLTeaser> is the teaser in HTML format to be displayed with the link to the Best Bet. Please note that the teaser will not be displayed by the standard web part.
See also
Get-FASTSearchSearchSettingGroup
Add multiple Best Bets to a keyword
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
At the Windows PowerShell command prompt, create a collection of existing Best Bets that you want to add:
$bestBetsToBeAdded = @("<BestBet1>", "<BestBet2>", "<BestBet3>", "<BestBet4>")
Where:
- <BestBet1-4> are the Best Bets that you want to add.
Get all search setting groups:
Get-FASTSearchSearchSettingGroup >>Name : 9c65a55f-eafc-451d-b0f5-56fbed465141 >>Description : >>Id : 1 >>LastChanged : 10/19/2010 9:04:46 AM
Add the collection of Best Bets to a keyword:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>") foreach($bestBetsToBeAdded in "<$bestBetsToBeAdded>") {$keyword.AddBestBet($bestBetToBeAdded)}
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<KeywordTerm> is the keyword term string name of an existing keyword.
<$bestBetsToBeAdded> is a variable that contains an existing array or collection of strings specifying the names of the existing Best Bets to be added.
See also
Get-FASTSearchSearchSettingGroup
Remove a Best Bets from a keyword
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
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
Remove a Best Bet from a keyword:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>") $keyword.RemoveBestBet("<BestBetName>")
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<KeywordTerm> is the keyword term string name of an existing keyword.
<BestBetName> is the title of the Best Bet to be removed.
See also
Get-FASTSearchSearchSettingGroup
Remove all Best Bets from a keyword
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
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
Remove all Best Bets from a keyword:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>") $keyword.BestBets.Clear()
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<KeywordTerm> is the keyword term string name of an existing keyword.
See also
Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace
Get-FASTSearchSearchSettingGroup
Add a global Best Bet
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
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
Add a global Best Bet:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $searchSettingGroup.BestBetsWithoutKeyword.AddBestBet("<GlobalBestBetName>")
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<GlobalBestBetName> is the title of the global Best Bet to be added.
See also
Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace
Get-FASTSearchSearchSettingGroup
Add multiple global Best Bets
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
At the Windows PowerShell command prompt, create a collection of existing global Best Bets that you want to add:
$globalBestBetsToBeAdded = @("<GlobalBestBet1>", "<GlobalBestBet2>", "<GlobalBestBet3>", "<GlobalBestBet4>")
Where:
- <GlobalBestBet1-4> are the global Best Bets that you want to add.
Get all search setting groups:
Get-FASTSearchSearchSettingGroup >>Name : 9c65a55f-eafc-451d-b0f5-56fbed465141 >>Description : >>Id : 1 >>LastChanged : 10/19/2010 9:04:46 AM
Add the collection of global Best Bets:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" foreach ($globalBestBetToBeAdded in <$globalBestBetsToBeAdd>) { $searchSettingGroup.BestBetsWithoutKeyword.AddBestBet( $globalBestBetToBeAdded ) }
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<$globalBestBetsToBeAdded> is a variable that contains an existing array or collection of strings specifying the names of the existing global Best Bets to be added.
See also
Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace
Get-FASTSearchSearchSettingGroup
Remove a global Best Bet
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
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
Remove the global Best Bet:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $searchSettingGroup.BestBetsWithoutKeyword.RemoveBestBet("<GlobalBestBetName>")
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<GlobalBestBetName> is the title of the global Best Bet to be removed.
See also
Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace
Get-FASTSearchSearchSettingGroup
Remove all global Best Bets
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
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
Remove all global Best Bets:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $searchSettingGroup.BestBetsWithoutKeyword.Clear()
Where:
- <SearchSettingGroupName> is the name of an existing search setting group.
See also
Microsoft.SharePoint.Search.Extended.Administration.Keywords Namespace
Get-FASTSearchSearchSettingGroup
Display all Best Bets
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.
On the Start menu, click All Programs.
Click Microsoft FAST Search Server 2010 for SharePoint.
Click Microsoft FAST Search Server 2010 for SharePoint shell.
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
Display all Best Bets:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $searchSettingGroup.BestBets
Where:
- <SearchSettingGroupName> is the name of an existing search setting group.