Sie befinden sich hier:
Bearbeiten und Testen der Solr-Abfrage
Fügen Sie der Solr-Abfrage Parameter hinzu, die auf die Atom-XSL-Datei verweisen. Testen Sie dann Ihre Änderungen, um sicherzustellen, dass die Ergebnisse im XML Atom-Format angezeigt werden.
-
Fügen Sie diese Parameter der Solr-Abfrage hinzu:
wt=xsltundtr=file_name.xsl, wobei file_name dem Namen Ihrer Atom XSL-Datei entspricht. Beispiel:tr=acme.xsl. - Verwenden Sie diesen URL, um Ihre Abfrage zu testen: http://localhost:8983/solr/techproducts/select?q=sd500&wt=xslt&tr=example_atom.xsl. In diesem Test ist der Kernname techproducts und der Suchbegriff sd500.
Hier nun ein Beispiel für eine mit Atom XML formatierte Antwort.
<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>
