Tuesday, February 21, 2012

SharePoint 2010 Search, Best Bets

Here i just want to explain about ‘best bets’ functionality in this post.

Best bets essentially allows you to inject your chosen content at the top of search queries for certain keywords. As an example on my test bed site when ever someone types ‘javier’ I want to return three key items at the top. These three items will be:
  1. link to my twitter feed link
  2. link to my technical blog techgrowingpains.com
  3. link to my Linkedin page
Now, this is an example, but you can use this in a variety of other situations. For example for your companies’ SharePoint search you can use a keyword like ‘payroll’ and have it return links to your payroll system, or information to your payroll submission forms.
Create a Search Center
To leverage best bets we must use a search center. That is pretty easy. A search center in essence is a  subsite of your site. Click on Site Actions->New Site->Search->Basic Search Center. Lets fill it our with the following information, and select create. Take a look at the more options button if you want to modify it from the default settings.

Great once you select create it puts into your search center. If we try and search for the term ‘javier’ we get results, but not our best bests. Lets navigate back to our parent site.
Creating Best Bets
From here lets go back to our site settings. Remember this is our parent site and not the new site setting for the search center we just created. click Site Actions->Site Collection Administration->Search keywords->Add Keyword. I want my key word to be ‘javier’ but as we can see you can fill in synonyms as you need them. Optionally, you can add some type of definition to appear with the keyword result. In this case I’ll use ‘javi’ my nickname as a synonym.

Now that your key word is set lets create the actual best bets. Click on ‘Add Best Bet’.

Enter your information, and click OK. Let repeat that cycle to enter in the all the best bests we want, and in the order we want. If you take a look at the rest of the edit key word screen you will notice other options to add a contact and publishing options. Press OK when completed.
Lets test it out. I’ll navigate to your search center subsite and enter in my new keyword ‘javier’.

Great! now we have best bet set up and returning the information we want for our users. Almost complete but still not quite there…
Completing the Configuration
Lets test the search from our parent site.

hmm… as we can see no best bets here. The key is the URL.
1
http://javierbarrera.com/sites/test/_layouts/OSSSearchResults.aspx?k=javier&cs=This%20Site&u=http://javierbarrera.com/sites/test
Compare that to a search with in our search center subsite with the same exact term.
1
http://javierbarrera.com/sites/test/SearchCenter/results.aspx?k=javier
we need to link our parent site search bar to default to the new search center subsite. In the parent site click on site actions-> site settings-> search setings. Select ‘Enable custom scopes’ and fill in the appropraite link to your subsite. In my case that was ‘/sites/test/searchcenter’. I do not like to use full URL hard links because this offers the maximum versatility, and SharePoint is smart enough to add the appropriate completed link. In addition I chose, ‘Do not show scopes dropdown, and default to target results page’ under ‘specify the dropdown mode for Search Boxes:’. We will go over custom scopes later. click OK.
Now if we type in ‘javier’ from the parent’s search box it will return the proper results WITH the best bets.

Fantastic! Now, remember best bets is not available to SharePoint Foundation, but you can get it SharePoint 2010 Search Server Express, SharePoint 2010 Standard, and SharePoint 2010 Enterprise.

How to define a new Best Bet Keyword in SharePoint 2007?

  1. From your site home page, click "Site Actions/Site Settings/Modify All Site Settings".
  2. Under Site Collection Administration, click "Search Keywords".
  3. On the Manage Keywords page, click "Add Keyword".
  4. On the Add Keyword page, click "Add Best Bet".
  5. On the Add Best Bet popup page, enter the Target URL, Title and Description of the best bet and click "OK".
  6. Back on the Add Keyword page, enter the Keyword Phrase, Synonyms (separated by a semi colon), Definition, Contact Person and Expiration Date and click "OK".
  7. The new keyword and best bet should now be listed.
  8. Testing by searching for "My Phrase" should yield the Best Bet. You can customize where Best Bets show up on the results page. In our example's case, it was set to be the first results in the list.
  9. A search for any of the synonyms should yield the same result.