To transform the Solr default search results from JSON to XML Atom, create and publish an OpenSearch description file. This XML file defines the search query URL and supported parameters.
- To create an OpenSearch description XML file, see OpenSearch URL template syntax.
The query host, core name, and XSL file name are required.
- The OpenSearch description includes the minimum required.
<?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortName>Solr Search</ShortName> <Url type="application/atom+xml" template="http://localhost:8983/solr/techproducts/select?q={searchTerms}&wt=xslt&tr=example_atom.xsl"/> </OpenSearchDescription>
- The OpenSearch description includes the minimum required.
- Publish the XML file either with an HTTP file server or file sharing service. To publish
via Google Drive:
- Put the OpenSearch description XML file in a Google Drive folder.
- Set the share settings to make the file publicly visible.
- Determine the file direct-link URL using the Google Drive Direct-Link Generator.
- Note the URL to the published XML file. Use this URL when creating the OpenSearch external data source within Salesforce. The OpenSearch description is accessed only when creating the OpenSearch external data source or when the data source is synchronized.
Example OpenSearch can’t access XML files when Google Drive displays a
warning that the file can’t be scanned and asks if you wish to download the file
anyway.