Building Search Applications in SharePoint
Server 2010 for Search and FAST Search
Server 2010 for SharePoint: Lesson 7 Lab
This document is provided “as-is”. Information and views expressed in this document, including URL and
other Internet Web site references, may change without notice. You bear the risk of using it.
Some examples depicted herein are provided for illustration only and are fictitious. No real association or
connection is intended or should be inferred.
This document does not provide you with any legal rights to any intellectual property in any Microsoft
product. You may copy and use this document for your internal, reference purposes.
© 2010 Microsoft Corporation. All rights reserved.

Building Search Applications in SharePoint
Server 2010 for Search and FAST Search
Server 2010 for SharePoint: Lesson 7 Lab
Summary: This is the lab excercises for Building Search Applications in SharePoint Server 2010
for Search and FAST Search Server 2010 for SharePoint: Lesson 6 Personalize Search: User
Context Driven Search.
Applies to: Microsoft SharePoint Server 2010 | Microsoft FAST Search Server 2010 for
SharePoint Federation
Published: September 2010
Provided by: Anthony Butcher, Senior Consultant, FAST - Global Services, EMEA | David de
Santiago, Senior Consultant, FAST - Global Services, EMEA | Roberto Fanelli, Senior Consultant,
FAST - Global Services, EMEA | Microsoft Corporation
Contents
User Context Definition .......................................................................................................................................2
Create a user Context:........................................................................................................................................2
Configure User Profiles ........................................................................................................................................3
Configuring keywords and best bets .....................................................................................................................5
Running searches with two users to deliver targeted best bets. ................................................................................6
Site Promotion – User Context driven ...................................................................................................................7
Conclusion.........................................................................................................................................................8
User Context Definition
User contexts enable targeted search improvements by limiting the effect of best bets, visual
best bet, document promotions, document demotions, site promotions and site demotions to a
sub-group of employees. For instance, a best bet can be configured to be displayed only for Los
Angeles Lakers fans when searching for specific keywords. Another best bet for Boston Celtics
can be also displayed for another fan based in Boston when searching for the same keyword.
Create a user Context:
1. From Fast Search for SharePoint Search Centre
1. Click on Site Actions
2. Click on Site Settings
3. Click on Site collection and Fast Search User Contexts.
Page ii
4. Create two user contexts:

User context Name: los angeles lakers

Office location: los angeles

Ask me about: los angeles, lakers, nba, basketball

User context name: boston celtics

Office location: boston

Ask me about: boston, celtics, nba, basketball
Configure User Profiles
The first step will consist of configuring the ‘lakers’ user.
1. Log into SharePoint intranet site (http://intranet.contoso.com/search/Pages/default.aspx)
with username CONTOSO\lakers; userpassword: pass@word1

Click on Edit My Profile and add the following:

Ask me about: los angeles, lakers, nba, basketball

Office Location: los angeles
Page iii
2. The second step will consist of configuring the ‘celtics’ user.

Log into SharePoint intranet site
(http://intranet.contoso.com/search/Pages/default.aspx) with username
CONTOSO\celtics; userpassword: pass@word1

Click on Edit My Profile and add the following:

Ask me about: boston, celtics, nba, basketball

Office Location: boston
Page iv
Configuring keywords and best bets
Best Bets can be accessed via the Search Centre Website:
1. Click on Site Actions
2. Click on Site Settings
3. Click on FastSearch Keywords
4. Create a new keyword:

Keyword name: nba

Keyword synonym: basketball
5. Add a first Best Bet pointing to the boston celtics user context:
6. Specify a Title such as ‘Boston Celtics!’
7. Specify a Description: ‘Boston Celtics! That’s my team!
Page v
8. Specify a URL: ‘http://www.celtics.com’
9. Add a User context: select the boston celtics user context
10. Add a second Best Bet pointing to the los angeles lakers user context:

Specify a Title such as ‘LAKERS LAKERS LAKERS!!!’

Specify a Description: ‘LAKERS!’

Specify a URL: ‘http://www.lakers.com’

Add a User context: select the los angeles lakers user context
(For automated creation of keywords, synonyms and best bet, please refer to module:
Building an Enterprise Search Application – Keywords - Best Bets – Synonyms)
Running searches with two users to deliver
targeted best bets.
1. Log into the Fast Search for SharePoint Search Centre as user ‘lakers’
2. Run a search for ‘nba’
3. Verify that you get the Lakers best bet:
Page vi
NBA keyword
best bet
Lakers best bet
4. Log into the Fast Search for SharePoint Search Center as user ‘Celtics’
5. Run a search for ‘nba’
6. Verify that you get the Celtics best bet:
NBA keyword
best bet
Celtics best bet
Site Promotion – User Context driven
Similar to Best Bets Site promotions and demotions can be driven by User contexts.
Search results can be influenced by the SharePoint user attributes and trigger the promotion of
documents containing a certain ‘URL’ pattern
The following PowerShell code will add a site promotion called ‘boost my lakers document
library’.

The boost value will be set to 650

The URL pattern that will trigger the boost will be: http://intranet.contoso.com/lakers

The user context used is ‘los angeles lakers’.
Page vii
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name
"<searchsettinggroup>"
$globalPromotions = $searchSettingGroup.PromotionsWithoutKeyword
$globalPromotion = $globalPromotions.AddPromotion("boost my lakers document
library")
$globalPromotion.BoostValue = 650
$uri = New-Object -TypeName System.Uri -ArgumentList
http://intranet.contoso.com/lakers
$globalPromotion.PromotedItems.AddPromotedLocation($uri)
$globalPromotion.Contexts.AddContext({los angeles lakers})
The following code will add a site promotion for the ‘boston’ user:
$searchSettingGroup = Get-FASTSearchSearchSettingGroup -Name
"<searchsettinggroup>"
$globalPromotions = $searchSettingGroup.PromotionsWithoutKeyword
$globalPromotion = $globalPromotions.AddPromotion("boost my Celtics document
library")
$globalPromotion.BoostValue = 650
$uri = New-Object -TypeName System.Uri -ArgumentList
http://intranet.contoso.com/celtics
$globalPromotion.PromotedItems.AddPromotedLocation($uri)
$globalPromotion.Contexts.AddContext({boston celtics})
To get the search setting group:
$ssg = Get-FASTSearchSearchSettingGroup
$ssg
Conclusion
This concludes the lab excercises for Building Search Applications in SharePoint Server 2010 for
Search and FAST Search Server 2010 for SharePoint: Lesson 6 Personalize Search: User
Context Driven Search.
Page viii