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: