Keyword Management (FAST Search Server 2010 for SharePoint)
Updated: February 2011
You can use the keyword management features in Microsoft FAST Search Server 2010 for SharePoint to provide more relevant query results to different groups of users. This includes synonyms, Best Bets and promotions of pages or sites.
Keyword terms are defined by an administrator to improve search results. When a query includes a keyword term or one of its synonyms, any recommended results in the form of Best Bets or Visual Best Bets can be returned with the query result.
Best Bets, Visual Best Bets, document promotions, and document demotions can be associated with defined user contexts. These user contexts enable administrators to recommend results that are relevant to a specific user group.
In this article:
Applies to: Microsoft FAST Search Server 2010 for SharePoint
When you create a custom search application, you must provide the user context information in the query. You can add one or more user context specifications by using the UserContext Element in Microsoft.Search.Query Schema. You add the actual context specification to the UserContextData Element.
The userContextString is a string formatted according to the following format:
The keyword key (for example, "responsibilities").
If the key contains any of the special characters colon (":"), backslash ("\"), or pipe ("|"), they must be escaped.
The delimiter used to delimit multiple values. The first instance of the delimiter is enclosed in ":" characters, and specifies the delimiter value used in the following string. If the context string has only one value, D is left empty ("::"), which means that the key only has a single value.
The delimiter value can consist of one or more characters (a single character or a string such as ";", "$" or "STOP").
The delimiter cannot contain any special characters such as ":", "\", or "|".
Values for the key K. The values cannot contain the delimiter.
If the key contains any of the special characters ":", "\", or "|", they must be escaped.
Used to separate multiple key/value pairs.
A site administrator has defined a Visual Best Bet Dev Center to apply only if the user executing the query has the developer responsibility. In this case, the query must include the specification of the user's context, and a query for the user with this responsibility must include a userContextString as follows.
When using the QueryEx Query Web service method, you can request Best Bets and Visual Best Bets by using the IncludeSpecialTermResults element.
In the query result, you get the Best Bets and Visual Best Bets in the following tables:
SpecialTermResults: This table contains one row for each Best Bet defined for the keyword.
VisualBestBetsResults: This table contains one row for each Visual Best Bet defined for the keyword.
The two tables contain the same columns, as explained in Table 2.
The set of columns returned for Best Bets is different for SharePoint Server search and FAST Search Server 2010 for SharePoint.
The name of the Best Bet or Visual Best Bet.
An optional description.
The associated keyword. The keyword is provided in the following format:
Where <keyword> is the keyword that matches the query.
A teaser text that may be used in query results.
An optional content type (e.g. text/html) for the teaser.
The URI for the Best Bet or Visual Best Bet.
For a Best Bet, this is the URI that you can display on the query result page.
For a Visual Best Bet, this is the URI to the graphical element that you can display on the query result page.
The desired position of the Best Bet or Visual Best Bet in the query result. This column is only relevant when having more than one Best Bet or Visual Best Bet defined for a keyword.
If you use teaser or position for Best Bets or Visual Best Bets, make sure that you create and manage the keyword settings using Windows PowerShell and not the Site Collection UI. These settings are not available in the UI.
The following steps are an extension of Walkthrough: Querying FAST Search Server From a Client Application. Follow the steps in that article, and extend the code as described below.
The code extensions are as follows:
Request Best Bets or Visual Best Bets in the query XML
Print the Best Bets or Visual Best Bets data in the second DataGridView control
To extend the code for the Visual Studio client application
Replace the definition of the queryXML2 string, to add Best Bets and Visual Best Bets in the result set:
To include Best Bets in the query result, add the following code line to the queryButton_Click event:
To include Visual Best Bets in the query result, add the following code line to the queryButton_Click event: