SharePoint Tricks: Adding Google Search To Search Scopes
Tonight’s article is one based on a little trick I pulled of last year at one of my customer’s Intranet. As it turns out, there seems to be quite some people using Google Search (Live Search anyone?) ![]()
So how do we add this search scope? The trick lies in a custom page for the search scope. When creating a search scope in your site collection settings, you’re allowed to enter a custom search page.

This custom search page simply has to redirect to the google query webpage: eg.http://www.google.com/search?q=ENTER+A+WORD. Don’t forget to replace the ENTER+A+WORD content of the q variable with the k variable you find in the query string of the custom page. This is whare all the magic lies, you see. So in the end, we’re basicly rerouting the query from SharePoint to Google. Pretty simple, but very effective!

Hope you guys liked the trick. See you next time!
April 2nd, 2008 at 2:20
[...] SharePoint Tricks: Adding Google Search To Search Scopes [...]
April 13th, 2008 at 8:19
[...] SharePoint Tricks: Adding Google Search To Search Scopes. [...]
May 8th, 2008 at 4:58
Hi,
I am trying to do exactly what you have mentioned in this blog. But the problem is I can’t somehow replace content of q variable with the k variable. Would you be kind enough to explain this in bit more detail.
Thanks,
Gaurav
May 20th, 2008 at 20:54
Guarev,
In your code you are redirecting to a google url. As you placed the url in your code (probably in a string), you can replace your keyword (in this case “ENTER+A+WORD”, this can be whatever you want, you can even dynamically build the url to redirect to) with the k variale. After that, it’s just redirecting your page to the new url you created!
Good Luck!
May 30th, 2008 at 5:47
Thanks for your reply. I am new to it and still couldn’t understand how to accomplish this. Would you be able to give me step by step reply please ?
Thanks,
Gaurav
June 26th, 2008 at 18:56
Wow! That’s really sweet! Hey- real fast I made a .master file and uploaded it to my work’s new intranet. My supervisor can’t see it even though it’s published. She can see different premade ones- just not this one- any advice?
July 7th, 2008 at 19:29
Where did you upload it? You have to upload it to the master page catalog library. You can find this library on following location: http://ROOTOFSITECOLLECTION/_catalogs/masterpage/
Good luck!
July 11th, 2008 at 17:56
^_^!! Thank you!!! Yeah- I couldn’t publish it– but my intratnet is looking really spiffy!! <3 I’ll keep checking back!
November 11th, 2008 at 8:00
Well, instead of describing how easy it is, how about some detailed instructions, eg:
1. Make a copy of ..searchresults.aspx. Call it googleresults.aspx
2. Open googleresults.aspx in notepad and replace its contents with the following javascript block:…
3. Create a new search scope and point it to googleresults.aspx
Telling everyone how easy it is to do, does nothing more than massage your own ego…
November 11th, 2008 at 12:09
For the people still looking for the full code in searchgoogle.aspx. Here it is:
< %@Page Language="C#"%>
< % Response.Redirect("http://www.google.com/search/?q="+Request["k"],true); %>
Anonymous> Why is your message so hostile? From time to time I try to guide you guys to solutions. I’m not a step-by-step handbook. I still do this in my spare time.
November 12th, 2008 at 2:16
Tombo> sorry for the hostility. Your site was the only one that even remotely discussed the process. After a log Googling session, I finally came across your site, then your instructions were difficult to follow and I was very frustrated…
Thank you for updating the site and providing the code. It worked perfectly, with one minor alteration: There’s no ‘/’ after ’search’ in the Google url. It should be: http://www.google.com/search?q=“+Request
Thanks again and sorry for the emotive…