SharePoint Online – Searching the Internet

My client wanted to be able to search their public website from a page in a SharePoint Online (SPO) web site. I told them that this would be easy to do since I knew that there was an InternetSearchResults result source available by default in SPO. But after working with SharePoint for over 10 years, I should have remembered that just because something can be done in SharePoint it may take more effort than expected to implement. The InternetSearchResults result source uses the OpenSearch 1.0/1.1 protocol and it turned out that there is virtually no documentation provided by Microsoft regarding the use of this protocol

Paul Stork provided me some clues in his answers at https://social.technet.microsoft.com/Forums/en-US/de09c296-98b1-4779-95c4-bd3f18c0d56b/search-from-sharepoint-2013-team-site-intranet-to-internet?forum=sharepointsearch but this did not provide me the full answer to my problem

In the SP Admin Center, the Search page contains a link to Manage Result Sources. On this page, the InternetSearchResults source contains the following query:

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

Since this syntax calls search.live.com it is obviously quite old (Bing replaced Live around 2009).  Even though, it still functions, I decided that I would rather use bing.com. I did some research and found that:

  1. the acceptable parameters for an OpenSearch query are shown at OpenSearch parameters.
  2. the advanced search keywords for Bing at Bing Parameters

I thought that I would be able to simply add the parameter “site” to the end of the search query and set it to my client’s public web site domain as follows.

https://bing.com/search?q=searchTerms&count=itemsPerPage&first=startItem&mkt=language&format=rss&FORM=SHAREF&site:client.com

However, this did NOT work.

I did some testing and thinking and realized that since the “site” parameter is the most limiting value of the query that it would need to be at the beginning of the statement. Some other articles state that the “site” parameter can follow the Search Terms, but my tests did not confirm that syntax.

I found that a specific internet site could be searched in SPO (as well as other SP versions) by using the following syntax.

http://bing.com/search?q=site:client.com&{searchTerms}&count={itemsPerPage}&first={startItem}&mkt={language}&format=rss&FORM=SHAREF

I hope that this can help someone else who needs to solve this type of problem. Please let me know if you have any questions