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

SharePoint Online – Search Results not Sorted

While using the People Search Core Results web part, I changed the query and set the Sorting value to a RefinableString that was configured to be sortable. However, the search results were not displaying in the sort order. It turns out that the Available Sort Orders (JSON) setting in the Results Control Settings section of the web part task pane supersede the Sort Order specified in the Query.

I had to change the  Available Sort Order to the following:

 [{“name”:”Last name (A-Z)”,”sorts”:[{“p”:”RefinableString00″,”d”:0}]},{“name”:”Last name (Z-A)”,”sorts”:[{“p”:”RefinableString00″,”d”:1}]},{“name”:”First name (A-Z)”,”sorts”:[{“p”:”FirstName”,”d”:0}]},{“name”:”First name (Z-A)”,”sorts”:[{“p”:”FirstName”,”d”:1}]}]

Thanks to the articles at http://stevemannspath.blogspot.com/2013/03/sharepoint-2013-allowing-users-to-sort.html and http://www.sharepointconfig.com/2013/05/how-to-create-a-simple-sharepoint-2013-people-directory/

 

Why I Need a Blog

I received a request for assistance from one of employees, and after working on the problem for 30 minutes, I got nowhere. I came back to work a few days later and she asked me if I had the problem fixed, I didn’t, so I took a look again and all of a sudden it seemed very familiar. I did a search on the internet and found several articles about the problem. One of the proposed answers was something that I had written 16 months earlier that I had forgotten about. I NEED this blog to help me keep track of things that I have learned. Hopefully, it may help some other people also.