Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Einstein Search
Create the Atom XSL File

Create the Atom XSL File

To transform the Solr default search results from JSON to XML Atom, you create an XSL file. Solr provides example files that you can customize for your server.

  1. Find a sample Atom XSL file from the Solr distribution at solr.6.5.1/server/solr/configsets/sample_techproducts_configs/xslt/example_atom.xsl.
  2. Save the file in the xslt folder that has the example xsl file.
  3. In the entry section, edit the name, features, and timestamp names of the title, summary, and updated fields, respectively. This section transforms the search results into Atom. When changing the names, review the example XML files in the solr.6.5.1/example/exampledocs folder created when Solr was installed. Or run a search against Solr, and review the JSON search results.
Example
Example

Here’s an example of an Atom XSL file.

 <!-- search results xslt -->
  <xsl:template match="doc">
    <xsl:variable name="id" select="str[@name='id']"/>
    <entry>
      <title><xsl:value-of select="str[@name='name']"/></title>
      <link href="http://localhost:8983/solr/select?q={$id}"/>
      <id>tag:localhost,2007:<xsl:value-of select="$id"/></id>
      <summary><xsl:value-of select="arr[@name='features']"/></summary>
      <updated><xsl:value-of select="date[@name='timestamp']"/></updated>
    </entry>
  </xsl:template>
 
Loading
Salesforce Help | Article