Add, remove and display synonyms for keywords by using Windows PowerShell (FAST Search Server 2010 for SharePoint)(informazioni in lingua inglese)
Aggiornato: 10 febbraio 2011
Nota
This article describes how to manage synonyms by using Windows PowerShell. For information about how to manage synonyms by using the graphical user interface, see Manage FAST Search keywords (Office.com)..
Use synonyms only to improve recall for small result sets. If you add synonyms to keywords that already have a large result set, the additional results will be added to the end of the result set, and the search performance will be reduced.
Do not use synonyms for multiple versions of a word, for example car and cars. The stemming functionality in FAST Search Server 2010 for SharePoint will handle different versions of the same word. For more information about stemming, see Tune linguistic relevance (FAST Search Server 2010 for SharePoint)(informazioni in lingua inglese).
In this article the following Windows PowerShell procedures are described:
Add a synonym to a keyword
Add multiple synonyms to a keyword
Remove a synonym from a keyword
Remove all synonyms from a keyword
Display all synonyms
Turn off recall for synonyms
Add a synonym 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 synonym to a keyword:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>") $keyword.AddSynonym("<SynonymTerm>")
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<KeywordTerm> is the keyword term string name of an existing keyword.
<SynonymTerm> is the synonym term to be added.
See also
Get-FASTSearchSearchSettingGroup
Add multiple synonyms 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 the synonyms that you want to add:
$synonymsToBeAdded = @("<Synonym1>", "<Synonym2>", "<Synonym3>", "<Synonym4>")
Where:
- <Synonym1-4> are the synonyms 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 synonyms to a keyword:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>") foreach($synonymToBeAdded in "<$synonymsToBeAdded>") {$keyword.AddSynonym($synonymToBeAdded)}
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<KeywordTerm> is the keyword term string name of an existing keyword.
See also
Get-FASTSearchSearchSettingGroup
Remove a synonym 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 synonym from a keyword:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>") $keyword.RemoveSynonym("<SynonymTerm>")
Where:
<SearchSettingGroupName> is the name of an existing search setting group.
<KeywordTerm> is the keyword term string name of an existing keyword.
<SynonymTerm> is the synonym term to be removed.
See also
Get-FASTSearchSearchSettingGroup
Remove all synonyms 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 synonyms from a keyword:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" $keyword = $searchSettingGroup.Keywords.GetKeyword("<KeywordTerm>") $keyword.Synonyms.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
Display all synonyms
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 synonyms:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name "<SearchSettingGroupName>" foreach ($keyword in $searchSettingGroup.Keywords) { $keyword.Synonyms }
Where:
- <SearchSettingGroupName> is the name of an existing search setting group.
See also
Get-FASTSearchSearchSettingGroup
Turn off recall for synonyms
When a search is rewritten because of keyword synonyms, search performance is affected. The degree of search latency increase depends on:
The number of synonyms added to the search.
The number of documents in the corpus.
The number of terms in each synonym, if it is a phrase.
If you do not want the increased recall from synonyms, or if the search latency increase is unacceptable, you can turn off recall of keyword synonyms by changing a configuration option. On every FAST Search Server 2010 for SharePoint server that runs the query service, follow these steps:
You are a member of the FASTSearchAdministrators local group on the computer where FAST Search Server 2010 for SharePoint is installed.
On the FAST Search Server 2010 for SharePoint administration server, open <FASTSearchInstallationFolder>\META\config\profiles\default\templates\installer\etc\admin.config.template in a text editor (<FASTSearchInstallationFolder> is the path of the folder where you have installed FAST Search Server 2010 for SharePoint, for example C:\FASTSearch).
Replace this line:
<add key="SynonymQueryRecall" value="true" />
with the following:
<add key="SynonymQueryRecall" value="false" />
Save the file.
Stop the FAST Search for SharePoint service.
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, type the following command:
Set-FASTSearchConfiguration
Start the FAST Search for SharePoint service.
See also
Cronologia delle modifiche
Data | Descrizione | Motivo |
---|---|---|
10 febbraio 2011 |
2011/02/07 |
Aggiornamento contenuto |