Working With SharePoint 2010 Search - Part 2

 

Welcome! You can read Part 1 here. In Part 2, you will learn the following:

a. Using federated search

b. Using federated search connector

c. Showing Google search results in SharePoint 2010

d. Showing Bing search results in SharePoint 2010

e. Showing Youtube search results in SharePoint 2010

 

1. Open SharePoint Central Adminsite.

2. Click General Application Settings.

3. Click Farm Search Administration in Search section.

Figure 1: Farm Search Administration

 4. Click Search Service Applicationlink.

5. Click Federated Locations.

Figure 2: Federated Locations

6. Click New Location.

7. In Display Name, enter Google News. In Description, enter Returns results from news.google.com.

8. Expand Location Information node and select OpenSearch 1.0/1.1. In Query Template, enter http://news.google.com/news?hl=en-us&ned=us&ie=UTF-8&q={searchTerms}&output=rss.

9. Click OK at the bottom. Now it's time to try the google search. Go to SharePoint search center site. You will add Federated Results web part to the search results page. This is a very common mistake people make. They add the web part to the search page and then complain that no results are shown. Remember, web part has to be added to results page, not the search page. If you don't want to add the web part on the default search results page, you can create a new results page and add it there. To see how to add new search results page, check out first part of this article series. To add web part to default results page, make sure you open that page. Easy way is to search something, results will be shown on results page. When on results page, you can then edit that page. Results page URL will look something like http://yourserver/searchcentersite/Pages/results.aspx?k={searchTerm}. When you are on results page, click Site Actions  click Edit Page.

10. In the Right Zone, click Add a Web Part. From Categories select Search and then from Web Parts select Federated Results and click Add.

11. Open web part properties and click Edit Web Part.

Figure 3: Edit Web Part

12. Under Federated Results, in Location Properties, open Location drop down and select Google News. This is the source that you added in the steps above. Click OK. Click Save & Close button in the ribbon to save the changes.

13. Time to test federated search! Open search page, and enter a term in the search box and search it. You will see results from SharePoint as well as from Google. Google results will appear on the right side.

Figure 4: Google search results

Using Federated Search Connector

14. There is another way of bringing Google news to SharePoint. You can download federated search connector for Google from the Microsoft site. Here is the link:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13784

Open this page in browser and download GoogleNews.OSDXfile.

15. Go to Central Admin site and open Search service application page. See steps above to see how to open Search service application. On this page, click Federated Locations. Click Import Location.

16. Browse to the location where you downloaded the OSDX file and select it. Click Open. Click OK and then click Done.

17. Now connect this federated location to the search results page in SharePoint. You have already seen how to do it above. Add a federated search web part. Edit its properties and in the Location, select Google News. Click OK.

18. Test federated location. This will show search results from google news. What is the difference between this federated location and the one we used above? No difference! There we just added a Google URL to search Google. Now we have an XSL that we can edit and change how the search results look. To edit XSL, open the newly added federated location in central admin site. Query Template will be same as before. "More Results" Link Template will now have a URL. This option specifies the URL of the web page that displays results for a search query. This shows a More Results link beneath the search results. Expand Display Information node. XSL box has XSL that you can modify if you want. Properties box shows properties. You can edit values on this page OR you can directly edit the .OSDX file and then import it in federated locations.

Using Internet Search Results federated location

This option is available by default. On Manage Federated Locations page in Central Admin site, this is the first option that you see.

19. Click Internet Search Results federated location. Open Location Information node. In Query Template, you will see following URL listed:

http://search.live.com/results.aspx?q={searchTerms}&count={itemsPerPage}&first={startItem}&mkt={language}&format=rss&FORM=SHAREF

20. To use this federated location, add Federated Results web part to search results page. Edit properties and in Location, select Internet Search Results. Click OK.

Showing Bing results in SharePoint Search

21. This out of the box federated location uses live.com site. If you want to use bing site, add a new federated location (as described above) and in the Query Template, add following URL:

http://www.bing.com/search?q={searchTerms}&go=&form=QBLH&qs=n&format=rss

Search results will now show results from Bingsite.

Showing results from Youtube.com

22. In this last section, we will add new federated location. To show search results from Youtube.com, download connector from the Microsoft site. Here is the URL:

http://www.microsoft.com/downloads/details.aspx?FamilyID=29b06f0d-4522-4ece-a803-e512a3d140d2

Download YouTube.OSDX file from thsi page. Create new federated location and import this file.

23. In the search results page, add a new Federated Results web part. Edit properties and In Location select YouTube. Click Ok.

24. Try new search. You will notice that search results show missing image. To fix this, download youtube logo from the following location:

http://walisystemsinc.com/sharepoint/art/spsearch2/images/youtube_logo.jpg

25. Copy downloaded logo to the following location on your SharePoint server:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\IMAGES

26. Go to Federated Locations in central administration. Click YouTube. Expand Display Information. In the XSL, click ellipsis button to open XSL in dialog box. Locate img tag and replace src property with the following value:

http://yourserver/_layouts/1033/IMAGES/youtube_logo.jpg

Note: Replace yourserver with your server name.

27. Click Ok.

28. Open SharePoint search center site to test the new federated location. Federated search results will now show youtube logo instead of a missing file image. This looks professional at least. Click the youtube logo to open the search result.

Figure 5: YouTube Search Results

29. To download other federated search connectors, visit following Microsoft page:

http://technet.microsoft.com/en-us/enterprisesearch/ff727944.aspx

This page has federated search connectors for the following:

1. Bing News
2. Business Week
3. Google News
4. The Register
5. Yahoo! News
6. Bing Image
7. Flickr
8. Yahoo! Images
9. YouTube
10. Google Blog Search
11. Bing
12. Bing Local
13, Encyclopedia
14. Britannica
15. MSDN
16. TechNet
17. Wikepedia
18. Yahoo!

With these federated search connectors, you can pass query from SharePoint to a target system and display results returned from that system inside SharePoint.