I had a query from a client to show federated search results for Google instead of the default Bing (when using SharePoint 2007).
After some searching I found that Google does not fully support the Open Search protocol that SharePoint expects to connect to for a custom federated location.
Whilst there are a number of API options that Google exposes to make your own connector, I came across an article which uses screen scraping and regular expressions to build a Open Search compliant results set which you can then hook into a custom federated location.
This method is not overy robust given that formatting changes will be the catalyst for updating the regular expression, however where you have other requirements for federated sources (e.g. dictionaries or perhaps relevant professional body news sites) this approach can be applied.
I based my solution on this article: http://www.21apps.com/sharepoint/search-server-2008-federated-sites-that-do-not-return-xml/
The key changes that I needed to make to the approach explained is:
- Update the .cs file’s regular expression
“<li><h3 class=\”r\”><a href=\”(?’link’.*?)\” class=l(.*?)>(?’title’.*?)</a></h3><div class=\”s\”>(?’desc’.*?)<br>”
- Within the federated location, provided Common credentials within the Restrictions and Credentials Information section (e.g. NTLM – specify username and password) unless you are setting this up on an anonymous access site
I have included the modified files available from the source article HERE
The finished result:
Hopefully the above proves useful if you need to federate locations which do not support open search or have an appropriate API to interact with.