Recently I was looking into the implementation of the OpenSearch / Federated Search on our SharePoint environment using the existing Google Search appliance. While we all know that SharePoint supports the Open Search but there are very limited documentation around integrating with the Google Search appliance.
I found a very good article about the tokens used by the SharePoint which can be passed to the GSA. I am also listing the tokens for a reference and more details can be found on the original article (http://sharepointtaproom.com/tag/sharepoint-search/).
- {SearchTerms}
- {startIndex}
- {startPage}
- {count}
- {itemsPerPage}
- {language}
- {inputEncoding}
- {outputEncoding}
So in this blog, we will see the steps to implement the OpenSearch with GSA.
Enable the OpenSearch on GSA:
- Enable the Open Search using the steps provided on this link.
- Note: The rss.xslt on the above link is wrong and change the namespace url from “http://a9.com/-/spec/os/1.1/” to “http://a9.com/-/spec/opensearch/1.1/” . Otherwise the paging on the SharePoint will not work. More details about the OpenSearch schema can be found here.
Configure / Create a result source using the GSA result endpoint:
- Configure / Create a result source using the below url using the SharePoint UI or Powershell.
- Replace the gsa url parameters with the above tokens . (ex:http://gsa/search?q=bill+material&start={startIndex}&num={itemsPerPage}&output=xml_no_dtd&proxystylesheet= test&client=test&site=operations)
- Configure the search results web part to get the results from the above created result source.
Debugging the OpenSearch results:
- Download a sample search results xml from your GSA or use one of the samples available on the open search website.
- Copy the file and configure the local IIS site so that the xml can be accessed from the browser. (ex: http://localhost/gsasample.xml). This will allow us to test our search result web parts for the given xml output from the federated search results without actually getting it from the GSA.
- Configure the result source as below:
- Configure the search result webpart to get the results from the above result source.
The above screen displays the results returned by the below xml (gsasample.xml).
<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>Example.com Search: New York history</title> <link>http://example.com/New+York+history</link> <description>Search results for "New York history" at Example.com</description> <opensearch:totalResults>4230000</opensearch:totalResults> <opensearch:startIndex>21</opensearch:startIndex> <opensearch:itemsPerPage>10</opensearch:itemsPerPage> <atom:link rel="search" type="application/opensearchdescription+xml" href="http://example.com/opensearchdescription.xml"/> <opensearch:Query role="request" searchTerms="New York History" startPage="1" /> <item> <title>New York History</title> <link>http://www.columbia.edu/cu/lweb/eguids/amerihist/nyc.html</link> <description> ... Harlem.NYC - A virtual tour and information on businesses ... with historic photos of Columbia's own New York neighborhood ... Internet Resources for the City's History. ... </description> </item> </channel> </rss>