Yesterday, we looked at how you can add new suggested keywords to SharePoint 2010 search allowing users to pick the most popular keyword before they execute a search query. You can also suggest for users to search for a new term based on the results from the executed query. This can be achieved by using Related Queries or Related Searches web part.
By default, the list of related searches will be populated the same way query suggestions get populated – when users click 6 or more times on the search result from the search keyword they searched for.
If you want to test the functionality in your demo environment or bulk populate the list of related searches you can use the following PowerShell:
PS C:\Users\Administrator> $searchapp= Get-SPEnterpriseSearchServiceapplication -Identity "FASTQuery"
PS C:\Users\Administrator> New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language en-us -Type QuerySuggestionAlwaysSuggest -Name "SharePoint Server 2010
This list gets propagated to the rest of the search components on a schdule defined in Prepare query suggestions time job, which runs on a defined schedule. You can run the job immediately right from UI or PowerShell:
Start-SPTimerJob -identity "Prepare Query Suggestions"
To remove the suggested query from the list, run below followed by running the time job:
Remove-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language en-Us -Type QuerySuggestionAlwaysSuggest -Identity "SharePoint Server 2010"
Enjoy!
