Online Training On SharePoint
                      

Sunday, 31 January 2010

Creating Auto Suggest Query Suggestion in FAST Search for SharePoint 2010

With SharePoint 2010 user gets query suggestions when they type search queries in the Search Text box (Available both with SharePoint and FAST Search). These query suggestions are automatically created over a period of time for any query that has a specified number of results clikcthroughts.
If we want we can manually create the Query Suggestion. In this post I will show you how to create the Query Suggestion for the FAST Search. The Query Suggestions needs to be created using PowerShell. First we need get the Query SSA for FAST Search by using the following command:

$SearchApp = Get-SPEnterpriseSearchServiceApplication
(Add the FAST Query SSA as a parameter.)

Now to add a query suggestion, use the following command:
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $SearchApp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "Query Suggestion Name"

These suggestions are compiled by the "Prepare Query Suggestions" job in Central Administration. This job is scheduled to run once in a day. If we need to see these suggestions immediately we need to run this job. Either this can be done using Central Administration UI or using the following PowerShell command:
Start-SPTimerJob -Identity "Prepare Query Suggestions"

I have put two suggestion with SharePoint 2010 and Sheet. Once we start typing Sh these will start appearing:


If we need to remove a query suggestion we can use the following command:
Remove-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $SearchApp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Identity "Suggestion Name"

To display all the query suggestions we can use the following command:
Get-SPEnterpriseSearchQuerySuggestionCandidates -SearchApplication $SearchApp

Also if a user does not want to see these query suggestion they can be stopped from Preferences and then unchecking the box showing the search suggestion:

Post a Comment
Related Posts with Thumbnails