Edit and Test the Solr Query

Add parameters that reference the Atom XSL file to the Solr query. Then test your changes to make sure that results are appearing in XML Atom format.

  1. Add these parameters to the Solr query: wt=xslt and tr=file_name.xsl, where file_name is the name of your Atom XSL file. For example, tr=acme.xsl.
  2. Use this URL to test your query: http://localhost:8983/solr/techproducts/select?q=sd500&wt=xslt&tr=example_atom.xsl. In this test, the core name is techproducts and the search term is sd500.
Example
Example

Here’s an example of a response formatted in Atom XML.

<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Example Solr Atom 1.0 Feed</title>
   <subtitle>
     This has been formatted by the sample "example_atom.xsl" transform - use your own XSLT to get a nicer Atom feed.
   </subtitle>
   <author>
     <name>Apache Solr</name>
     <email>solr-user@lucene.apache.org</email>
   </author>
   <link rel="self" type="application/atom+xml" href="http://localhost:8983/solr/q=sd500&wt=xslt&tr=atom.xsl"/>
   <updated/>
   <id>tag:localhost,2007:example</id>
   <entry>
     <title>Canon PowerShot SD500</title>
     <link href="http://localhost:8983/solr/select?q=9885A004"/>
     <id>tag:localhost,2007:9885A004</id>
     <summary>
       3x zoop, 7.1 megapixel Digital ELPHmovie clips up to 640x480 @30 fps2.0" TFT LCD, 118,000 pixelsbuilt in flash, red-eye reduction
     </summary>
   <updated/>
   </entry>
</feed>