One of the cool features available both with FS4SP and SP2010 is the ability to have query suggestions. You know, those suggestions that appear as you start typing in a search box and sometimes help you direct your query to what you want.
Other people already have posted very good material about query suggestions and how to add them to FS4SP. You can find a great post from Steve Peschka about it here.
One thing that people have been asking me about when they hear about the wonders of a system that automatically generates new query suggestions based on user queries is this: “can I block some terms from been suggested?”
This seemed like a fair question to which I only recently found the answer. Yes, you can block terms that you don’t want to have suggested to your users and to do this we are going to use the same cmdlet used to manually add query suggestions, but with a small twist.
The cmdlet in question is New-SPEnterpriseSearchLanguageResourcePhrase, which is part of the SP2010 cmdlets. The small twist here will be the parameter type, which we will define as QuerySuggestionBlockList to indicate that we want to block a term from appearing in the list of query suggestions.
Let’s say you want to prevent the term “soccer” from been suggested (maybe you have something against the sport, who knows?
). The list of commands to block this term will look like this:
$searchapp = Get-SPEnterpriseSearchServiceApplication "FAST Query SSA"
New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language en-us -Type QuerySuggestionBlockList –Name soccer
Start-SPTimerJob -Identity "Prepare query suggestions"
Things to pay attention to:
FAST Query SSA is the name of the FAST Search Query SSA you created when you configured FS4SP
en-us is the language of the term you want to block (recommendations are suggested based on the query language of the user)
“Prepare query suggestions” is the timer job that runs every night to generate the list of query suggestions (we force it to run so we don’t have to wait until tomorrow to test
)
In case you change your mind later and want to remove “soccer” from the list of blocked terms, allowing it to be freely suggested again, simply execute this list of cmdlets:
$searchapp = Get-SPEnterpriseSearchServiceApplication "FAST Query SSA"
Remove-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language en-us -Type QuerySuggestionBlockList –Identity soccer
Start-SPTimerJob -Identity "Prepare query suggestions"
Enjoy!
Pingback: クエリー候補に出したくないキーワードの登録 « エンタープライズサーチ ナウ