While Working onsite with a Client recently there was a question about whether you could use Google as a search Scope within there sharepoint site, The Answer to begin with was that I wasn’t actually sure as you have to convert the Query string from K to Q and I didn’t know how to do this part but after reading this post it seems fairly straight forward. Will Post my results soon as im yet to try this and from my seat in the Hotel Lobby im writing this in and a laptop with 5% battery left ill do this another day.

This is for SharePoint 2010, I have got this working for SharePoint 2013 but its slightly different as you don’t have scopes in 2013 you need to add the Redirect page in the Search Settings Page within the SharePoint Site.

Reference : https://www.thorprojects.com/blog/archive/2012/10/05/adding-a-google-search-option-in-your-sharepoint-2010-search-scopes-without-code.aspx

Create the Scope

If you want to create a global scope you can go into Central Administration then Service Management for the Search Service and finally Scopes on the left, or you can create the scope at the site collection level by selecting the Search Scopes option from Site Settings as shown:

Note that you’ll want to check the Search Dropdown checkbox to get it to show up in the search scopes drop down and that the page being referred to in the target results page must be created. Also, you’ll need to add a rule to the scope. Once you hit OK you’ll be back at the list of the scopes and there will be a link to add rules. You should add a rule for all content (because it’s simple).

Once you hit OK you’ve got a fully functioning scope that’s ready for use – just as soon as the system gets around to it. While we’re waiting, let’s go setup the page.

Creating the Redirect Page

In my case, I am using a simple search center for this demo so I went in and copied the default.aspx page and removed the existing web parts. Then I added a content editor web part with some JavaScript to do a redirect to the Google search page. So here’s the bit that’s important. SharePoint automatically appends the search terms with a k= to the query string (k is for keyword). Google needs the query to be a q=, so we’ll have our JavaScript change the k= for a q=. The script looks like this:

<script language=”javascript”>
var queryString = window.location.search;
if (queryString.indexOf(‘k=’) != -1) {
var fullUrl = ‘http://www.google.com/search’ + queryString.replace(‘k=’, ‘q=’);
window.location.replace(fullUrl);
}
</script>

You’ll notice that in the script I check to see if there’s a k= in the querystring and only redirect if there is one – this is so we can manage the page without being redirected. I wrapped this script up into a Content Editor Web Part (which you can get here). I added this web part to my page and it was ready to redirect me to google.

Processing Scopes

If I was patient (and I’m not) I could have just waited for everything to be ready, however, I can also go back into Search management (through central administration) and if there’s a Scopes needing update shown there is also a Start update now link you can click to force search to compile the scopes for use as shown:

Once the search scope is compiled you can enable the scopes drop down list and use the link to Google.

Turning on Scopes for Most Pages

For the standard search box you can enable the scopes drop down list by going to Site Settings – Search Settings and changing the search dropdown mode to show scopes:

Once you hit OK, everywhere that there is a search box in the site collection should now have a scopes drop down list – that is except a search page, which has its own settings.

Turning on Scopes for a Search Page

For a search page you can turn on the scopes dropdown box by placing the page in edit mode then select Edit Web Part from the web part control menu (upper right). Expand the Scopes Dropdown section and select ‘ Show scopes dropwdown’. This will cause the scopes to show.

Testing

To test the setup just go into search, select the Google search scope and enter a search term